fix: use bot user ID for proper avatar attribution in commits#1262
fix: use bot user ID for proper avatar attribution in commits#1262paulbalaji merged 1 commit intomainfrom
Conversation
GitHub requires the bot user ID (not app ID) in the commit email
to properly display the GitHub App's avatar. This adds an API call
to fetch the bot user ID before configuring git.
Format change:
- Before: {APP_ID}+{app-slug}[bot]@users.noreply.github.com
- After: {BOT_USER_ID}+{app-slug}[bot]@users.noreply.github.com
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
|
📝 WalkthroughWalkthroughThree GitHub workflows are updated to retrieve the GitHub App bot user ID via API call instead of pulling it from secrets, then use this ID when configuring git credentials. The same pattern is applied consistently across combine.yml, release.yml, and update-hyperlane-deps.yml. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes
Possibly related PRs
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 |
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
.github/workflows/combine.yml (1)
33-42: Cross-workflow suggestion: add error handling to the API calls.Now that you've got three workflows using the same pattern, consider adding error handling to catch API failures early. Here's a refactor you could apply to all three:
- - name: Get GitHub App User ID - id: get-user-id - run: echo "user-id=$(gh api /users/${{ steps.generate-token.outputs.app-slug }}[bot] --jq .id)" >> "$GITHUB_OUTPUT" + - name: Get GitHub App User ID + id: get-user-id + run: | + set -o pipefail + USER_ID=$(gh api /users/${{ steps.generate-token.outputs.app-slug }}[bot] --jq .id) + if [ -z "$USER_ID" ]; then + echo "Error: Failed to retrieve GitHub App user ID" >&2 + exit 1 + fi + echo "user-id=$USER_ID" >> "$GITHUB_OUTPUT"This would catch and fail fast if something goes wrong instead of silently continuing with an empty email.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
.github/workflows/combine.yml(1 hunks).github/workflows/release.yml(1 hunks).github/workflows/update-hyperlane-deps.yml(1 hunks)
🔇 Additional comments (3)
.github/workflows/release.yml (1)
39-48: Solid approach to fetching the bot user ID from the API.The implementation correctly retrieves the bot user ID via the GitHub API and uses it to construct the git email. The token handling and output variable setup look good.
One thing worth considering: there's no error handling if the
gh apicall fails. If it silently fails (maybe network hiccup or permission issue), theuser-idoutput would be empty, and line 48 would end up with a malformed email like+hyper-gonk[bot]@users.noreply.github.com. Not a deal-breaker, but you might want to addset -o pipefailor explicit error handling to catch that case early..github/workflows/update-hyperlane-deps.yml (1)
30-39: Clean and consistent with the other workflows.This follows the exact same pattern as the release workflow, which is nice for maintainability. The step placement—after checkout but before any git operations—makes sense. Same caveat as the other files: consider adding error handling in case the API call doesn't return what we expect.
.github/workflows/combine.yml (1)
33-42: Consistently applied across all three workflows.Good to see the same pattern implemented here. The git config gets set up before the
combine-dataandcommit-changessteps, which is what you need. Like the others, this would benefit from error handling on that API call, but the implementation itself is spot-on.
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
Summary
Problem
GitHub requires the bot user ID (not app ID) in the commit email to properly display the GitHub App's avatar.
Before:
{APP_ID}+{app-slug}[bot]@users.noreply.github.comAfter:
{BOT_USER_ID}+{app-slug}[bot]@users.noreply.github.comTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.