ci: use GITHUB_TOKEN instead of PAT for PR severity workflow

The PR severity classifier only needs to run `gh pr view`, `gh pr edit`
(labels), and `gh pr comment`. All three operations are fully covered by
the built-in GITHUB_TOKEN given the existing permissions block:

  permissions:
    contents: read
    pull-requests: write
    issues: write

The workflow uses `pull_request_target`, which runs in the base repo
context, so GITHUB_TOKEN has write access even for fork PRs.

Inspection of the claude-code-action@v1 source confirmed that the only
internal call that would require `contents: write` is branch deletion,
which is never exercised here because Claude's tools are locked down to
`gh pr view/edit/comment` via --allowedTools.

This removes the dependency on the PR_SEVERITY_BOT_TOKEN PAT secret.
This commit is contained in:
ziggie 2026-04-08 14:49:16 +02:00
parent 167f03bb32
commit 77c566f2fa
No known key found for this signature in database
GPG key ID: 1AFF9C4DCED6D666

View file

@ -35,7 +35,7 @@ jobs:
uses: anthropics/claude-code-action@v1
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
github_token: ${{ secrets.PR_SEVERITY_BOT_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}
# Allow any user since this workflow only reads PR metadata via API
# and doesn't execute any code from the PR. Tool permissions are