fix(ci): set explicit commit author for update-binaries job#457
Merged
fix(ci): set explicit commit author for update-binaries job#457
Conversation
The git-auto-commit-action defaults commit_author to github.actor, which on scheduled runs resolves to a former org member. Use the GitHub App identity instead. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: App ID used instead of bot user ID in email
- Added a step that fetches the
[bot]machine user ID viagh api users/{slug}%5Bbot%5Dand uses that ID in the noreply email instead of the GitHub App ID.
- Added a step that fetches the
Or push these changes by commenting:
@cursor push b9348db254
Preview (b9348db254)
diff --git a/.github/workflows/update-deps.yml b/.github/workflows/update-deps.yml
--- a/.github/workflows/update-deps.yml
+++ b/.github/workflows/update-deps.yml
@@ -58,11 +58,18 @@
token: ${{ steps.app_token.outputs.token }}
- name: Download latest binaries.
run: script/sentry-cli-download.sh
+ - name: Resolve bot user ID for noreply email
+ id: bot_user
+ env:
+ GH_TOKEN: ${{ steps.app_token.outputs.token }}
+ run: |
+ BOT_ID=$(gh api "users/${{ steps.app_token.outputs.app-slug }}%5Bbot%5D" --jq .id)
+ echo "id=${BOT_ID}" >> "${GITHUB_OUTPUT}"
- name: Commit latest binaries.
uses: stefanzweifel/git-auto-commit-action@04702edda442b2e678b25b537cec683a1493fcb9 # v7.1.0
with:
branch: ${{ needs.update-cli.outputs.prBranch }}
commit_message: bump bundled binaries
- commit_author: "${{ steps.app_token.outputs.app-slug }}[bot] <${{ vars.SENTRY_FASTLANE_PLUGIN_UPDATER_GITHUB_APP_ID }}+${{ steps.app_token.outputs.app-slug }}[bot]@users.noreply.github.com>"
+ commit_author: "${{ steps.app_token.outputs.app-slug }}[bot] <${{ steps.bot_user.outputs.id }}+${{ steps.app_token.outputs.app-slug }}[bot]@users.noreply.github.com>"
commit_user_name: "${{ steps.app_token.outputs.app-slug }}[bot]"
- commit_user_email: "${{ vars.SENTRY_FASTLANE_PLUGIN_UPDATER_GITHUB_APP_ID }}+${{ steps.app_token.outputs.app-slug }}[bot]@users.noreply.github.com"
+ commit_user_email: "${{ steps.bot_user.outputs.id }}+${{ steps.app_token.outputs.app-slug }}[bot]@users.noreply.github.com"This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
The noreply address must use the machine user's numeric ID from the Users API, not the GitHub App ID, so commits link to the bot account. Applied via @cursor push command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


The
stefanzweifel/git-auto-commit-actionin theupdate-binariesjobdefaults
commit_authorto${{ github.actor }}. For scheduled workflowruns, GitHub resolves
github.actorto a former org member (brustolin),causing the "bump bundled binaries" commit to be attributed to them
instead of the GitHub App.
This sets explicit
commit_author,commit_user_name, andcommit_user_emailusing the GitHub App identity from theactions/create-github-app-tokenoutput (app-slug), followingGitHub's bot email convention (
{APP_ID}+{SLUG}[bot]@users.noreply.github.com).#skip-changelog