Skip to content

Commit b6d6502

Browse files
bpamiriclaude
andauthored
ci: unblock bot-triage for read-permission contributors (#2587)
The `anthropics/claude-code-action@v1` action defaults to rejecting actors without write permission to the repo — a sensible default for PR-related automation, but exactly backward for issue triage on a public OSS bug tracker, where contributors filing bugs are precisely who we want responded to. Symptom: 5 of the last 13 bot-triage runs failed at the "Run Triage" step with `Actor does not have write permissions to the repository`, producing zero triage comments on issues opened by external contributors. Fix: - `allowed_non_write_users: '*'` — the action input designed for this exact case. Docs name "issue labeling" as the canonical example. - Added `workflow_dispatch` with `issue_number` input so missed issues can be re-triaged without close/reopen. - Hardened the `if:` guard so the wheels-bot self-loop check no longer evaluates `github.event.issue` on dispatch events. Safe because the workflow runs with `permissions: contents: read`, posts via an App token independent of the actor, and `claude_args` restricts the model's shell to `gh` + read-only `git` + file reads. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a99f75f commit b6d6502

1 file changed

Lines changed: 19 additions & 5 deletions

File tree

.github/workflows/bot-triage.yml

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ name: Wheels Bot — Triage
33
on:
44
issues:
55
types: [opened, reopened]
6+
workflow_dispatch:
7+
inputs:
8+
issue_number:
9+
description: 'Issue number to triage (use when the original issues:opened event missed or failed)'
10+
required: true
11+
type: string
612

713
permissions:
814
contents: read
915

1016
concurrency:
11-
group: wheels-bot-triage-${{ github.event.issue.number }}
17+
group: wheels-bot-triage-${{ github.event.issue.number || inputs.issue_number }}
1218
cancel-in-progress: false
1319

1420
jobs:
@@ -18,7 +24,7 @@ jobs:
1824
timeout-minutes: 25
1925
if: |
2026
vars.WHEELS_BOT_ENABLED == 'true'
21-
&& github.event.issue.user.login != 'wheels-bot[bot]'
27+
&& (github.event_name != 'issues' || github.event.issue.user.login != 'wheels-bot[bot]')
2228
env:
2329
WHEELS_CI: "true"
2430
steps:
@@ -40,8 +46,8 @@ jobs:
4046
uses: ./.github/actions/wheels-bot-skip-check
4147
with:
4248
target-type: issue
43-
target-number: ${{ github.event.issue.number }}
44-
marker-pattern: 'wheels-bot:triage:${{ github.event.issue.number }}|wheels-bot:triage-class:'
49+
target-number: ${{ github.event.issue.number || inputs.issue_number }}
50+
marker-pattern: 'wheels-bot:triage:${{ github.event.issue.number || inputs.issue_number }}|wheels-bot:triage-class:'
4551
github-token: ${{ steps.app-token.outputs.token }}
4652

4753
- name: Run Triage
@@ -52,10 +58,18 @@ jobs:
5258
# bot and github-actions[bot] in case an upstream automation creates
5359
# an issue we want to triage. Specific allowlist (not '*') — public repo.
5460
allowed_bots: 'wheels-bot[bot],github-actions[bot]'
61+
# Public OSS bug tracker: issues come from contributors without write
62+
# permission. The action's default actor-permission gate would reject
63+
# them, so we bypass it here. This is safe because: (a) workflow has
64+
# `contents: read` only, (b) the App token used for commenting is
65+
# independent of the actor, (c) claude_args below restricts shell to
66+
# gh + read-only git + file reads — no Write/Edit/general Bash. The
67+
# action's docs name "issue labeling" as the canonical use case.
68+
allowed_non_write_users: '*'
5569
anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
5670
github_token: ${{ steps.app-token.outputs.token }}
5771
prompt: |
58-
/triage-issue ${{ github.event.issue.number }}
72+
/triage-issue ${{ github.event.issue.number || inputs.issue_number }}
5973
claude_args: |
6074
--model claude-sonnet-4-6
6175
--max-turns 200

0 commit comments

Comments
 (0)