Skip to content

fix(ci): set explicit commit author for update-binaries job#457

Open
philprime wants to merge 1 commit intomasterfrom
fix/update-deps-commit-author
Open

fix(ci): set explicit commit author for update-binaries job#457
philprime wants to merge 1 commit intomasterfrom
fix/update-deps-commit-author

Conversation

@philprime
Copy link
Copy Markdown
Member

@philprime philprime commented Mar 27, 2026

The stefanzweifel/git-auto-commit-action in the update-binaries job
defaults commit_author to ${{ github.actor }}. For scheduled workflow
runs, GitHub resolves github.actor to 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, and
commit_user_email using the GitHub App identity from the
actions/create-github-app-token output (app-slug), following
GitHub's bot email convention ({APP_ID}+{SLUG}[bot]@users.noreply.github.com).

#skip-changelog

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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 27, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@philprime philprime enabled auto-merge (squash) March 27, 2026 13:51
Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

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 via gh api users/{slug}%5Bbot%5D and uses that ID in the noreply email instead of the GitHub App ID.

Create PR

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.

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_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"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

App ID used instead of bot user ID in email

Medium Severity

The noreply email uses vars.SENTRY_FASTLANE_PLUGIN_UPDATER_GITHUB_APP_ID (the GitHub App ID), but GitHub's noreply email convention for bots requires the bot user ID — the numeric ID of the {slug}[bot] machine user account, which is a different number. The app ID is confirmed by its use as the app-id input to create-github-app-token. Using the wrong ID means commits will be created successfully but won't display the [bot] badge or link to the App's profile on GitHub, partially defeating the purpose of this change. The bot user ID can be obtained via gh api "/users/{slug}%5Bbot%5D" --jq .id.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor

@itaybre itaybre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants