diff --git a/.github/workflows/pr-agent.yml b/.github/workflows/pr-agent.yml index 6191c19..9b58fab 100644 --- a/.github/workflows/pr-agent.yml +++ b/.github/workflows/pr-agent.yml @@ -92,11 +92,11 @@ jobs: echo "::add-mask::$token" echo "ANTHROPIC_WIF_TOKEN=$token" >> "$GITHUB_ENV" - name: Run PR-Agent - # PR-Agent v0.50.0, the `0.50.0-github_action` image by digest. The action - # repository only wraps a rolling image tag, so the digest is the real pin - # (PR-Agent SECURITY.md). To upgrade, take the digest of the new - # `-github_action` tag on Docker Hub. - uses: docker://pragent/pr-agent@sha256:548e894a88071180832b2f4233f734d0acd0db1a879e2fcbaa70bac8b8372ebe + # The org's wrapper action runs the PR-Agent v0.50.0 image by digest + # (actions/pr-agent/action.yml). A direct `docker://` step fails to start in + # repositories that allow only listed actions; an org action is always allowed. + # After a change to the wrapper, pin its new commit here. + uses: tilorahdotco/.github/actions/pr-agent@aa9a0efa08f43d1bce5711130246d485236bf939 env: # LiteLLM sends an `sk-ant-oat` token as `Authorization: Bearer`. ANTHROPIC.KEY: ${{ env.ANTHROPIC_WIF_TOKEN }} diff --git a/actions/pr-agent/action.yml b/actions/pr-agent/action.yml new file mode 100644 index 0000000..eda051d --- /dev/null +++ b/actions/pr-agent/action.yml @@ -0,0 +1,10 @@ +name: PR-Agent (pinned image) +description: >- + Runs PR-Agent v0.50.0 from its `0.50.0-github_action` image by digest. The upstream + action only wraps a rolling image tag, so the digest is the real pin (PR-Agent + SECURITY.md). It lives in this repository so that repositories that allow only + listed actions and require SHA pins can run it. To upgrade, take the digest of the + new `-github_action` tag on Docker Hub. Settings come from the step's env. +runs: + using: docker + image: docker://pragent/pr-agent@sha256:548e894a88071180832b2f4233f734d0acd0db1a879e2fcbaa70bac8b8372ebe diff --git a/docs/USAGE.md b/docs/USAGE.md index 3020d31..341d7f1 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -222,6 +222,9 @@ jobs: runner: instabox-small # public repositories: ubuntu-latest ``` +- A repository that requires SHA pins (intersects) cannot use `@main`. It pins the + commit of this workflow instead, and that exact commit must be listed in the + rule's condition (Claude Console, Workload identity, rule `pr-agent-org`). - Tokens act as the `pr-agents` service account and work only in the `pr-cicd` Anthropic workspace, which has its own spend limit. No repository needs an Anthropic secret. @@ -232,7 +235,7 @@ jobs: `[pr_reviewer] extra_instructions`. No other PR-Agent command runs. - A fork PR gets no automatic review. A maintainer's `/review` comment on it runs from the default branch and reviews it; PR-Agent reads the diff and runs no PR code. -- The PR-Agent image is pinned by digest in the workflow. Use a runner with Docker: +- The PR-Agent image is pinned by digest in the org action `actions/pr-agent`, which the workflow pins by commit. Use a runner with Docker: instabox or GitHub-hosted, not the `cjbb2-ci` fallback runner. - A failed exchange fails the job with Anthropic's error type. The deny reason is in the Claude Console under Workload identity, History.