From 389bd20c41718b003c631d7ae188ee8f1aeab0f4 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Tue, 11 Nov 2025 16:37:09 +0000 Subject: [PATCH] ci(dependabot-rebuild): configure git user dynamically for dependabot rebuild (#42) --- .github/workflows/dependabot-rebuild.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dependabot-rebuild.yml b/.github/workflows/dependabot-rebuild.yml index 26ffe89..6ede8d2 100644 --- a/.github/workflows/dependabot-rebuild.yml +++ b/.github/workflows/dependabot-rebuild.yml @@ -20,6 +20,14 @@ jobs: with: app-id: ${{ secrets.BOT_APP_ID }} private-key: ${{ secrets.BOT_PRIVATE_KEY }} + - name: Get GitHub App User ID + id: get-user-id + run: echo "user-id=$(gh api "/users/${{ steps.app-token.outputs.app-slug }}[bot]" --jq .id)" >> "$GITHUB_OUTPUT" + env: + GH_TOKEN: ${{ steps.app-token.outputs.token }} + - run: | + git config --global user.name '${{ steps.app-token.outputs.app-slug }}[bot]' + git config --global user.email '${{ steps.get-user-id.outputs.user-id }}+${{ steps.app-token.outputs.app-slug }}[bot]@users.noreply.github.com' - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 with: token: ${{ steps.app-token.outputs.token }} @@ -34,8 +42,6 @@ jobs: - name: Commit and push if changed run: | if [ "$(git diff --ignore-space-at-eol --text dist/ | wc -l)" -gt "0" ]; then - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" git add dist/ git commit -m "chore: rebuild dist" git push