# Gadfly against an OpenAI-COMPATIBLE endpoint. # Copy to .gitea/workflows/adversarial-review.yml in your repo. # # Works for: a local Ollama's OpenAI bridge (http://localhost:11434/v1), an # in-house gateway, OpenRouter, vLLM, LM Studio, etc. This is the same code path # the real OpenAI API uses, so it's a free way to exercise the OpenAI provider. # # Set GADFLY_API_KEY (or OPENAI_API_KEY) — Ollama ignores it, but most gateways # require some value. name: Adversarial Review (Gadfly) on: pull_request: types: [opened, reopened, ready_for_review] issue_comment: types: [created] workflow_dispatch: inputs: pr_number: { description: "PR number to review", required: true } permissions: contents: read issues: write pull-requests: write concurrency: group: gadfly-${{ github.event.issue.number || github.event.pull_request.number || github.event.inputs.pr_number }} cancel-in-progress: true jobs: review: # Security: only trusted users may trigger a secret-bearing run via a PR # comment (pull_request + workflow_dispatch are already trusted). Replace the # username(s) below with your maintainers — keep them in sync with # GADFLY_ALLOWED_USERS (the in-container belt-and-suspenders check). if: >- github.event_name != 'issue_comment' || github.actor == 'your-username' runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: docker://gitea.stevedudenhoeffer.com/steve/gadfly:latest env: GITEA_API: ${{ github.server_url }}/api/v1/repos/${{ github.repository }} GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }} # --- OpenAI-compatible endpoint --- GADFLY_PROVIDER: openai GADFLY_BASE_URL: http://localhost:11434/v1 # e.g. local Ollama /v1, or your gateway GADFLY_API_KEY: ${{ secrets.OPENAI_API_KEY }} # any non-empty value for Ollama GADFLY_MODELS: qwen2.5-coder:7b # --- event context (leave as-is) --- EVENT_NAME: ${{ github.event_name }} PR: ${{ github.event.pull_request.number || github.event.issue.number || github.event.inputs.pr_number }} PR_BRANCH: ${{ github.head_ref }} IS_DRAFT: ${{ github.event.pull_request.draft }} COMMENT_BODY: ${{ github.event.comment.body }} COMMENT_ID: ${{ github.event.comment.id }} ACTOR: ${{ github.actor }}