Use GitHub App token instead of default token#314
Conversation
It will fire workflows that can't be with the default token.
WalkthroughThe changes remove a GitHub Actions linter configuration file that excluded a specific policy warning and update the release workflow. The workflow now generates a GitHub App token with specific permissions and disables credential persistence during checkout, modifying how tokens are handled in the release process. Changes
✨ Finishing Touches🧪 Generate Unit Tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Pull Request Overview
This PR replaces the default GITHUB_TOKEN with a GitHub App token for workflows that need elevated permissions.
- Disable checkout’s default credentials and add steps to generate an App token
- Inject the App token into the
tagprjob - Mirror the App token setup in the
releasejob and clean up lint config
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| .github/workflows/release.yml | Swapped out default token, added actions/create-github-app-token steps and updated GITHUB_TOKEN usage for tagpr |
| .github/ghalint.yml | Removed exclusion for checkout_persist_credentials_should_be_false policy |
Comments suppressed due to low confidence (2)
.github/workflows/release.yml:25
- After generating the App token in the
releasejob, you need to overrideGITHUB_TOKENfor subsequent steps (e.g.,env: { GITHUB_TOKEN: ${{ steps.app-token.outputs.token }} }) so actions use the new token instead of the default.
- name: 💳 Create GitHub App Token
.github/ghalint.yml:1
- [nitpick] Removing this exclusion may trigger lint failures for the persist-credentials rule. Ensure the updated workflows comply with the policy or reintroduce an appropriate exception.
-excludes:
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
66-73: Generate GitHub App token in the release job
The App token scoped tocontents: writeandpull-requests: writeis correctly generated for thehomebrew-taprepository.Consider renaming the step IDs (e.g.,
tagpr-app-tokenvs.release-app-token) to improve log clarity across jobs.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/ghalint.yml(0 hunks).github/workflows/release.yml(2 hunks)
💤 Files with no reviewable changes (1)
- .github/ghalint.yml
🔇 Additional comments (3)
.github/workflows/release.yml (3)
23-23: Disable credential persistence for security
Thepersist-credentials: falseflag ensures the defaultGITHUB_TOKENisn’t accidentally stored in Git config, preventing unintentional usage by downstream steps.
25-32: Introduce GitHub App token for the tagpr job
Replacing the default token with an App token scoped tocontents: writeandpull-requests: writecorrectly grants only the permissions needed to create tags and PRs.Please confirm that
TAGPR_APP_ID/TAGPR_PRIVATE_KEYare configured and that the App installation covers this repository.
40-40: OverrideGITHUB_TOKENwith the App token
SettingGITHUB_TOKEN: ${{ steps.app-token.outputs.token }}makes theSongmu/tagpraction use the new App token. Ensure that this override behaves as expected during tagging.
close #
✏️ Description
It will fire workflows that can't be with the default token.