From 8323373a5c12825cd83b767dde7e709e81d5dfeb Mon Sep 17 00:00:00 2001 From: Colin Casey Date: Tue, 29 Aug 2023 15:00:47 -0300 Subject: [PATCH] Fix bot commit signing The previous configuration worked if commits were done manually with a `git commit ...` but the [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) action will use the GitHub Actions bot as committer and the user that triggered the workflow as author if `committer` and `author` are not given as inputs. --- .github/workflows/_buildpacks-prepare-release.yml | 9 +++------ .github/workflows/_buildpacks-release.yml | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/_buildpacks-prepare-release.yml b/.github/workflows/_buildpacks-prepare-release.yml index e12aee70..8fa7bb11 100644 --- a/.github/workflows/_buildpacks-prepare-release.yml +++ b/.github/workflows/_buildpacks-prepare-release.yml @@ -59,12 +59,6 @@ jobs: # that can be used to make signed commits that are attributed to the GH application user token: ${{ steps.generate-token.outputs.app_token }} - # This will ensure commits made from this workflow are attributed to the GH application user - - name: Configure git - run: | - git config --global user.name ${{ inputs.app_username }} - git config --global user.email ${{ inputs.app_email }} - - name: Install Languages CLI uses: heroku/languages-github-actions/.github/actions/install-languages-cli@main @@ -93,6 +87,9 @@ jobs: ${{ steps.generate-changelog.outputs.changelog }} branch: prepare-release delete-branch: true + # This will ensure commits made from this workflow are attributed to the GH application user + committer: ${{ inputs.app_username }} <${{ inputs.app_email }}> + author: ${{ inputs.app_username }} <${{ inputs.app_email }}> - name: Configure pull request if: steps.pr.outputs.pull-request-operation == 'created' diff --git a/.github/workflows/_buildpacks-release.yml b/.github/workflows/_buildpacks-release.yml index a1468c94..be12efe3 100644 --- a/.github/workflows/_buildpacks-release.yml +++ b/.github/workflows/_buildpacks-release.yml @@ -284,12 +284,6 @@ jobs: # that can be used to make signed commits that are attributed to the GH application user token: ${{ steps.generate-token.outputs.app_token }} - # This will ensure commits made from this workflow are attributed to the GH application user - - name: Configure git - run: | - git config --global user.name ${{ inputs.app_username }} - git config --global user.email ${{ inputs.app_email }} - - name: Install crane uses: buildpacks/github-actions/setup-tools@v5.4.0 @@ -317,6 +311,9 @@ jobs: path: ./builder branch: update/${{ github.repository }} delete-branch: true + # This will ensure commits made from this workflow are attributed to the GH application user + committer: ${{ inputs.app_username }} <${{ inputs.app_email }}> + author: ${{ inputs.app_username }} <${{ inputs.app_email }}> - name: Configure PR if: steps.pr.outputs.pull-request-operation == 'created'