From 6b92191a79fd5cf8c9302f1ab06a24328134319d Mon Sep 17 00:00:00 2001 From: Adam Moussa Date: Wed, 23 Sep 2026 20:07:44 -0400 Subject: [PATCH] fix(ci): link autofix commits to the bot account Use the bot account id in the noreply email so GitHub attaches the app logo. The App id prefix pushes a commit that stays unlinked. --- .github/workflows/ci-autofix.yaml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-autofix.yaml b/.github/workflows/ci-autofix.yaml index 1a94d9b..074eada 100644 --- a/.github/workflows/ci-autofix.yaml +++ b/.github/workflows/ci-autofix.yaml @@ -258,7 +258,7 @@ jobs: SKIP_BOT: ${{ steps.skip-bot.outputs.skip }} HEAD_REF: ${{ github.head_ref }} APP_SLUG: ${{ steps.app-token.outputs.app-slug }} - APP_ID: ${{ secrets.AUTOFMT_APP_ID }} + APP_TOKEN: ${{ steps.app-token.outputs.token }} run: | set -euo pipefail @@ -272,8 +272,16 @@ jobs: exit 1 fi + # The noreply local-part must be the bot account id, not the App id. + # An App-id prefix still pushes, but GitHub does not link the commit + # to the bot, so the app logo is not used. + bot_id=$(curl -fsSL \ + -H "Authorization: Bearer ${APP_TOKEN}" \ + -H "Accept: application/vnd.github+json" \ + -H "X-GitHub-Api-Version: 2022-11-28" \ + "https://api.github.com/users/${APP_SLUG}%5Bbot%5D" | jq -er '.id') git config user.name "${APP_SLUG}[bot]" - git config user.email "${APP_ID}+${APP_SLUG}[bot]@users.noreply.github.com" + git config user.email "${bot_id}+${APP_SLUG}[bot]@users.noreply.github.com" if [ -z "$(git status --porcelain)" ]; then echo "Tree is clean; no formatter commit."