fix(ci): pass GitHub App token to checkout for workflow triggering#7515
fix(ci): pass GitHub App token to checkout for workflow triggering#7515paulbalaji merged 1 commit intomainfrom
Conversation
|
📝 WalkthroughWalkthroughBoth release workflows now generate a GitHub App token early (before checkout) and reuse that single token for checkout, git configuration, changesets, and PR creation; duplicate token-generation steps were removed and publish-release additionally derives the bot user-id for git identity. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
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. Comment |
Configure both prepare-release and publish-release jobs to use the hyper-gonk GitHub App token. This fixes two issues: 1. CI workflows not triggering on commits pushed by the release workflow - `actions/checkout` configures git credentials at checkout time - Previously, checkout used default GITHUB_TOKEN which cannot trigger workflows - Now, token is generated first and passed to checkout 2. Commits authored by github-actions[bot] instead of hyper-gonk[bot] - The publish-release job was missing `setupGitUser: false` - It was running version step which creates commits as github-actions[bot] - Now uses same git config and token as prepare-release Changes: - release.yml: Add token generation, git config, and setupGitUser to both jobs - rust-release.yml: Same fix for release-pr job 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
f374616 to
4a1f77d
Compare
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/release.yml (1)
68-72: Minor consideration on gh api calls for user ID fetching.You're makin' API calls to fetch the bot user ID (lines 68-72 and 186-190) without explicit error handling. The
GH_TOKENenv var is set properly, so it should work, but if that API call ever fails, the workflow'll keep goin' (since there's noset -eor explicit exit handling). In practice, if the user ID fetch fails, the subsequentgit configwill just set a partial/empty email, which might not cause an immediate visible error but could cause confusion later.Not a blocker — the security model's sound and these API calls are straightforward — but if you wanted to tighten it up, you could add error handling or make the user ID output a required step.
If you'd like to make this more defensive, you could add
set -eor explicit error checks, but it's not essential given the straightforward nature of the API calls.Also applies to: 186-190
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between f374616ff0cbaa95f7a3cb4466f374bd1470d404 and 4a1f77d.
📒 Files selected for processing (2)
.github/workflows/release.yml(3 hunks).github/workflows/rust-release.yml(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (54)
- GitHub Check: cli-evm-e2e-matrix (warp-rebalancer)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-submitters)
- GitHub Check: cli-evm-e2e-matrix (warp-check-4)
- GitHub Check: cli-evm-e2e-matrix (warp-check-2)
- GitHub Check: cli-evm-e2e-matrix (warp-init)
- GitHub Check: cli-evm-e2e-matrix (warp-send)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-simple-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-check-1)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-config)
- GitHub Check: cli-evm-e2e-matrix (warp-read)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-basic)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-2)
- GitHub Check: cli-evm-e2e-matrix (warp-check-5)
- GitHub Check: cli-evm-e2e-matrix (warp-deploy-2)
- GitHub Check: cli-evm-e2e-matrix (warp-check-3)
- GitHub Check: cli-evm-e2e-matrix (warp-deploy-1)
- GitHub Check: cli-evm-e2e-matrix (warp-bridge-1)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-rebalancing-config)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-ism-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-extend-recovery)
- GitHub Check: cli-evm-e2e-matrix (relay)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-hook-updates)
- GitHub Check: cli-evm-e2e-matrix (warp-apply-ownership-updates)
- GitHub Check: env-test-matrix (mainnet3, optimism, igp)
- GitHub Check: env-test-matrix (mainnet3, optimism, core)
- GitHub Check: cli-evm-e2e-matrix (core-read)
- GitHub Check: cli-evm-e2e-matrix (core-deploy)
- GitHub Check: cli-evm-e2e-matrix (core-init)
- GitHub Check: cli-evm-e2e-matrix (core-check)
- GitHub Check: cli-evm-e2e-matrix (core-apply)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, core)
- GitHub Check: env-test-matrix (testnet4, sepolia, core)
- GitHub Check: env-test-matrix (mainnet3, ethereum, core)
- GitHub Check: env-test-matrix (mainnet3, ethereum, igp)
- GitHub Check: env-test-matrix (mainnet3, arbitrum, igp)
- GitHub Check: aleo-sdk-e2e-run
- GitHub Check: cli-radix-e2e-matrix (warp-apply-ownership-updates)
- GitHub Check: cosmos-sdk-e2e-run
- GitHub Check: cli-radix-e2e-matrix (core-deploy)
- GitHub Check: cli-radix-e2e-matrix (warp-apply-route-extension)
- GitHub Check: cli-radix-e2e-matrix (warp-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (core-read)
- GitHub Check: cli-cosmos-e2e-matrix (warp-read)
- GitHub Check: cli-cosmos-e2e-matrix (core-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (warp-deploy)
- GitHub Check: cli-cosmos-e2e-matrix (core-check)
- GitHub Check: cli-cosmos-e2e-matrix (core-apply)
- GitHub Check: cli-cross-chain-e2e-matrix (warp-deploy)
- GitHub Check: cli-cross-chain-e2e-matrix (warp-apply)
- GitHub Check: cli-install-test-run
- GitHub Check: e2e-matrix (evm)
- GitHub Check: lint-rs
- GitHub Check: test-rs
- GitHub Check: lander-coverage
🔇 Additional comments (6)
.github/workflows/rust-release.yml (3)
109-118: Token generation and checkout wiring looks solid.The token's generated before checkout and properly passed through, which'll let subsequent git operations actually trigger workflows. Good move gettin' the credentials set up front like that.
184-184: Proper git identity configuration from token.Pullin' the bot user ID from the app slug and configuring git with it — that's the right way. The token flows through GITHUB_TOKEN and git config picks it up for subsequent operations. Should work a treat.
Also applies to: 190-192
271-271: Publish job uses different approach for token handling.The publish job here doesn't wire the App token into checkout (line 271) like release-pr does. Instead, it uses the default GITHUB_TOKEN and hardcodes github-actions[bot] for git identity. This isn't necessarily wrong — the job explicitly triggers downstream workflows with
gh workflow run(lines 381-385) rather than relying on git push to do it. But worth notin' there's a difference in approach between this job and the publish-release job in release.yml, which does use the App token for checkout.If you're intentionally keepin' these different, that's fine — just good to be aware of the inconsistency.
Can you confirm whether the publish job's approach (explicit workflow triggers rather than App token for git ops) is the intended pattern here, or should it align with release.yml's publish-release job?
Also applies to: 276-276, 281-282
.github/workflows/release.yml (3)
43-58: Token generation and checkout integration in prepare-release is well done.Token's generated right up front, then passed straight into checkout via the token parameter. That's exactly what needs to happenin' for git credentials to be configured properly. The flow from token → checkout → subsequent operations is clean.
68-88: Git identity configuration and changesets setup is solid.Fetching the bot user ID via API (lines 68-72), configuring git with that identity (lines 74-77), then disabling changesets' built-in git setup (line 85) and passin' the generated token (line 88) — that's the whole picture done right. The token's bein' reused consistently, and git'll use it for all the operations that follow.
161-206: Publish-release job mirrors prepare-release pattern — good consistency.Same token → checkout → user ID → git config → changesets flow as prepare-release. Duplicatin' the pattern here is actually the right call for keeping jobs independent and clear about what they're doin'. Pattern's consistent within the file and matches the intent of the PR.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7515 +/- ##
============================
============================
🚀 New features to boost your workflow:
|
Summary
actions/checkoutfor git credential configurationsetupGitUser: falseand git config topublish-releasejobProblem 1: CI Not Triggering
When the release workflow pushes commits (e.g., "Version Packages"), CI doesn't run on those commits. This is because:
actions/checkoutconfigures git credentials at checkout timeGITHUB_TOKENwhich cannot trigger other workflows (GitHub security feature)Problem 2: Wrong Commit Author
The
publish-releasejob was creating "Version Packages" commits asgithub-actions[bot]because:setupGitUser: falsesetchangeset-release/main, overwriting hyper-gonk's commitsSolution
Generate the token before checkout and pass it via the
tokenparameter, then configure git for both jobs:Changes
release.yml:rust-release.yml: Same fix for release-pr jobNote:
combine.ymlandupdate-hyperlane-deps.ymlin hyperlane-registry already do this correctly.Test Plan
🤖 Generated with Claude Code