Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughModified the Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
There was a problem hiding this comment.
Pull request overview
This PR updates the org’s reusable Claude Code GitHub Actions workflow to ensure git push operations use a workflow-scoped PAT when modifying .github/workflows/*, avoiding the default GITHUB_TOKEN workflow-file write restriction.
Changes:
- Pass
GH_PAT_WORKFLOWS(with fallback togithub.token) toactions/checkoutin bothclaudeandclaude-issuejobs. - Align checkout credentials with the intended token used for subsequent pushes performed by Claude tooling.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Checkout repository | ||
| uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 | ||
| with: | ||
| fetch-depth: 1 | ||
| token: ${{ secrets.GH_PAT_WORKFLOWS || github.token }} |
There was a problem hiding this comment.
GH_PAT_WORKFLOWS is declared as optional (workflow_call.secrets.*.required: false) and this checkout token: input correctly falls back to github.token, but the subsequent anthropics/claude-code-action step in this job still sets github_token: ${{ secrets.GH_PAT_WORKFLOWS }} without a fallback. If the secret is unset/not inherited, the action will receive an empty token and may fail even though checkout succeeded; consider applying the same || github.token fallback (or omitting github_token when the secret is empty) to keep the workflow functional as described in the PR.



Problem
Claude Code action was unable to push commits touching
.github/workflows/*even afterGH_PAT_WORKFLOWSwas configured as an org-level secret. Every Claude run on a workflow-touching issue ended with:This blocked ~20 of 27 open compliance issues across the org (every
Compliance: missing-*.ymlandunpinned-actions-*.ymlticket).Root cause
actions/checkoutwas running without an explicittoken:input, so it stored the defaultGITHUB_TOKENin the local.git/configas the credential for subsequentgit pushcommands. The PAT was passed toclaude-code-actionasgithub_token, but the action's git push reuses the local git credentials checkout set up — so pushes still went out under the default token, which has the workflow-file write embargo.Confirmed empirically:
github-actions[bot], not the PAT user — proving the PAT was never reaching git push.workflow-scoped token.Fix
Pass
GH_PAT_WORKFLOWStoactions/checkoutin both jobs (claudeandclaude-issue), with a fallback togithub.tokenso the workflow keeps working if the secret is ever unset.Test plan
claudelabel onpetry-projects/google-app-scripts#122(Compliance: missing-agent-shield.yml)github-actions[bot])Summary by CodeRabbit