feat!: require App tokens, remove deprecated gh_pat fallback#114
feat!: require App tokens, remove deprecated gh_pat fallback#114cbeaulieu-gt merged 1 commit intomainfrom
Conversation
BREAKING CHANGE: The gh_pat input has been removed from all actions and reusable workflows. All write-capable actions now require app_id and app_private_key to generate GitHub App tokens. Additionally, all claude-code-action invocations now use the App token for github_token, ensuring comments post under the App's bot identity consistently. closes #107 closes #112 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @cbeaulieu-gt's task in 2m 16s —— View job PR Review Complete ✅This PR successfully removes the deprecated SummaryApproved with one suggested improvement — The breaking changes are appropriate for v2.0.0, security posture is improved, and documentation is thorough. However, there's an input validation inconsistency that should be addressed. Key Findings✅ Strengths
|
| Dimension | Assessment |
|---|---|
| Code quality | ✅ Excellent — consistent patterns, clear naming, proper shell quoting |
| Security | ✅ Improved — short-lived App tokens > long-lived PATs |
| Performance | ✅ No concerns — administrative workflow changes only |
| Test coverage | |
| Documentation | ✅ Comprehensive — CLAUDE.md, README.md, and PR description all updated |
Detailed Review by File
Workflows (3 files)
.github/workflows/ci-failure.yaml
- ✅ Removed
gh_patsecret and fallback logic - ✅ Marked
app_idandapp_private_keyasrequired: true - ✅ Removed
continue-on-error: truefrom token generation (fail fast is better) - ✅ Simplified token resolution to single path
.github/workflows/claude-lint-fix.yml
- ✅ Consistent with
ci-failure.yamlchanges - ✅ Removed
gh_patfrom bothlint-diagnoseandlint-applycalls
.github/workflows/apply-fix.yml
- ✅ Removed deprecated
github_token: ${{ secrets.GH_PAT }}line
Composite Actions (4 files)
apply-fix/action.yml
- ✅ Removed deprecated
github_tokeninput (was the old name forgh_patin this action) - ✅ Cleaner error message
⚠️ app_id/app_private_keyshould berequired: true(see issue above)
lint-apply/action.yml
- ✅ Removed
gh_patinput and fallback logic ⚠️ app_id/app_private_keyshould berequired: true
lint-diagnose/action.yml
- ✅ Removed
gh_patinput and fallback logic - ✅ Changed
github_tokenfrom${{ github.token }}to${{ steps.token.outputs.value }}inclaude-code-actioncall (line 114) - ✅ Improved PR number validation with regex pattern
⚠️ app_id/app_private_keyshould berequired: true
lint-failure/action.yml
- ✅ Removed
gh_patinput and fallback logic - ✅ Improved PR number validation with regex pattern
⚠️ app_id/app_private_keyshould berequired: true
Documentation (2 files)
CLAUDE.md
- ✅ Updated token selection guidance (line 53)
- ✅ Removed
GH_PATfrom required secrets table - ✅ Correctly notes that
pr-reviewusesgithub.token(read-only, no push)
README.md
- ✅ Removed
GH_PATfrom all secrets tables - ✅ Updated troubleshooting section to remove PAT fallback references
- ✅ Simplified "What happens when App token generation fails?" answer
Migration Impact
This is a well-justified breaking change for v2.0.0:
Breaking:
- Consumers using
gh_patmust migrate to GitHub App - No backward compatibility — immediate action required
Mitigated by:
- Clear migration guide in PR description
- Updated documentation with setup instructions
- Actionable error messages pointing to README
Timing: Appropriate for major version bump (v2.0.0)
Recommendation
Approve and merge after addressing the input validation inconsistency, or merge as-is and address in a follow-up if you want to ship v2.0.0 sooner. The inconsistency is a UX issue (confusing error messages) rather than a functional bug — the actions will still fail appropriately when tokens are missing.
Tasks
- Retrieve PR diff
- Review code quality and consistency
- Check security implications
- Verify documentation updates
- Post review feedback
Summary
This PR completes the v2.0.0 token cleanup by addressing two related issues:
gh_patinput from all actions #107 — Remove deprecatedgh_patinput from all actionsgithub_tokenin allclaude-code-actioninvocations #112 — Use App token forgithub_tokenin allclaude-code-actioninvocationsBreaking changes
gh_patinput has been removed fromlint-diagnose,lint-failure, andlint-applycomposite actions.github_tokeninput has been removed fromapply-fix(it was the deprecated fallback name for that action).gh_patsecret has been removed fromclaude-lint-fix.ymlandci-failure.yamlreusable workflow secrets.app_idandapp_private_keyare now required secrets inclaude-lint-fix.ymlandci-failure.yaml.continue-on-error: truesafety net on theGenerate App tokenstep inci-failure.yamlhas been removed — if App token generation fails, the workflow now fails immediately with a clear error message.What changed
Part 1 — Remove
gh_pat(#107):lint-diagnose/action.yml— removedgh_patinput andeliffallback in token resolutionlint-failure/action.yml— samelint-apply/action.yml— sameapply-fix/action.yml— removed deprecatedgithub_tokeninput andeliffallback.github/workflows/claude-lint-fix.yml— removedgh_patfrom secrets block and bothwith:blocks; markedapp_id/app_private_keyas required.github/workflows/ci-failure.yaml— removedgh_patfrom secrets block, removedcontinue-on-errorandeliffallback; markedapp_id/app_private_keyas required.github/workflows/apply-fix.yml— removedgithub_token: ${{ secrets.GH_PAT }}from the composite action callPart 2 — Use App token for
github_token(#112):lint-diagnose/action.yml— changedgithub_token: ${{ github.token }}to${{ steps.token.outputs.value }}in theclaude-code-actioninvocationlint-failure/action.yml— already usingsteps.token.outputs.value(no change needed)ci-failure.yaml— already usingsteps.token.outputs.value(no change needed)pr-review/action.yml— intentionally left unchanged.pr-reviewis read-only (no git push) and generates no App token. It correctly usesgithub.tokenfor posting review comments, which is appropriate for a read-only action.Docs:
CLAUDE.mdandREADME.mdupdated to remove all references toGH_PATas a fallback, and updated the troubleshooting section to reflect the new hard requirement.Migration guide for consumers
If you currently pass
gh_patto any action or workflow, you must migrate toapp_id+app_private_key:APP_IDandAPP_PRIVATE_KEYas repository secretsgh_pat/GH_PATsecret references from your caller workflowsPart of v2.0.0
This is a breaking change and is intended to ship as part of the v2.0.0 release.
🤖 Generated with Claude Code