Skip to content

Gate the Claude workflow on write access, not contribution history - #6260

Merged
ChrisJBurns merged 1 commit into
mainfrom
harden-claude-workflow-gate
Aug 10, 2026
Merged

Gate the Claude workflow on write access, not contribution history#6260
ChrisJBurns merged 1 commit into
mainfrom
harden-claude-workflow-gate

Conversation

@ChrisJBurns

Copy link
Copy Markdown
Collaborator

Stacked on #6259, which is stacked on #6258. Merge in order, or rebase once those land.

Summary

  • The trigger used a deny-list, and the gap was CONTRIBUTOR. It denied NONE, FIRST_TIMER and FIRST_TIME_CONTRIBUTOR — but CONTRIBUTOR is earned permanently by getting a single pull request merged, and it admitted MANNEQUIN as well. Any outside account that has landed one change could invoke the job from then on.
  • The job it guards is not a low-privilege one. It holds contents: write and ANTHROPIC_API_KEY, and allows Bash(git *), driven by the text of an issue or comment. The right bar is write access to the repository, not a history of contributing to it.
  • Replaced with the OWNER/MEMBER/COLLABORATOR allow-list already used by the /retest gate in retest.yaml, so there is now one idiom for "trusted enough to trigger privileged automation" rather than two.
Allowed
Before OWNER, MEMBER, COLLABORATOR, CONTRIBUTOR, MANNEQUIN
After OWNER, MEMBER, COLLABORATOR

An allow-list is also the more durable shape: GitHub can add association values, and a deny-list silently admits anything new.

Part of #6253

Type of change

  • Bug fix
  • New feature
  • Refactoring (no behavior change)
  • Dependency update
  • Documentation
  • Other (describe):

Test plan

  • Unit tests (task test)

  • E2E tests (task test-e2e)

  • Linting (task lint-fix)

  • Manual testing (describe below)

  • Enumerated every value of CommentAuthorAssociation against both the old and new conditions to confirm exactly which lose access: CONTRIBUTOR and MANNEQUIN, and nothing else.

  • All four event branches (issue_comment, pull_request_review_comment, pull_request_review, issues) keep their existing @claude body check and their existing association source — only the association test changed.

  • actionlint is clean on the file and the workflow parses.

Does this introduce a user-facing change?

Yes, for maintainers: @claude no longer responds to people without write access to the repository. Anyone who is OWNER, MEMBER or COLLABORATOR is unaffected. If an outside contributor should keep access, the fix is to add them as a repository collaborator rather than to widen this condition.

Special notes for reviewers

Generated with Claude Code

@ChrisJBurns
ChrisJBurns requested a review from JAORMX as a code owner August 10, 2026 17:17
@ChrisJBurns
ChrisJBurns force-pushed the harden-claude-workflow-gate branch from d26fba2 to b0897e8 Compare August 10, 2026 17:27
@ChrisJBurns
ChrisJBurns force-pushed the harden-claude-workflow-gate branch from b0897e8 to 7771c1d Compare August 10, 2026 17:28
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Aug 10, 2026
Base automatically changed from harden-pr-size-labeling to main August 10, 2026 17:31
The trigger denied NONE, FIRST_TIMER and FIRST_TIME_CONTRIBUTOR, which
still admitted CONTRIBUTOR and MANNEQUIN. CONTRIBUTOR is earned
permanently by getting a single pull request merged, so any outside
account that has landed one change could invoke the job afterwards.

That job holds contents: write and ANTHROPIC_API_KEY, and allows
Bash(git *), so the bar should be write access to the repository rather
than a history of contributing to it. Replaces the deny-list with the
OWNER/MEMBER/COLLABORATOR allow-list already used by the /retest gate.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ChrisJBurns
ChrisJBurns force-pushed the harden-claude-workflow-gate branch from 7771c1d to ff745e6 Compare August 10, 2026 17:31
@github-actions github-actions Bot removed the size/XS Extra small PR: < 100 lines changed label Aug 10, 2026
@ChrisJBurns
ChrisJBurns merged commit aa1628e into main Aug 10, 2026
16 checks passed
@github-actions github-actions Bot added the size/XS Extra small PR: < 100 lines changed label Aug 10, 2026
@ChrisJBurns
ChrisJBurns deleted the harden-claude-workflow-gate branch August 10, 2026 17:32
@codecov

codecov Bot commented Aug 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.72%. Comparing base (d163115) to head (ff745e6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6260      +/-   ##
==========================================
+ Coverage   72.71%   72.72%   +0.01%     
==========================================
  Files         742      742              
  Lines       77299    77299              
==========================================
+ Hits        56209    56218       +9     
+ Misses      17126    17119       -7     
+ Partials     3964     3962       -2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions github-actions Bot mentioned this pull request Aug 14, 2026
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants