From 4bf291cc0cceb1b5be5644478bda8da92ba90308 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Thu, 4 Jul 2024 09:06:22 +0200 Subject: [PATCH 1/2] Use workflow actor as git author --- .github/workflows/release.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0832b079955..8e96016fdac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,10 +9,6 @@ on: required: true type: "string" -env: - GIT_AUTHOR_EMAIL: "167856002+mongodb-dbx-release-bot[bot]@users.noreply.github.com" - GIT_AUTHOR_NAME: "mongodb-dbx-release-bot[bot]" - jobs: prepare-release: environment: release @@ -72,10 +68,12 @@ jobs: echo '🆕 Creating new release branch ${RELEASE_BRANCH} from ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY git checkout -b ${RELEASE_BRANCH} + # Set commit author information to the user that triggered the release workflow - name: "Set git author information" run: | - git config user.name "${GIT_AUTHOR_NAME}" - git config user.email "${GIT_AUTHOR_EMAIL}" + GITHUB_USER_ID=$(gh api users/${{ github.actor }} --jq '.id') + git config user.name "${{ github.actor }}" + git config user.email "${GITHUB_USER_ID}+${{ github.actor }}@users.noreply.github.com" # This step bumps version numbers in build.gradle and creates git artifacts for the release - name: "Bump version numbers and create release tag" From 876626698decd7f8c8a69cd530bd51bacb0a5933 Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Fri, 5 Jul 2024 14:29:18 +0200 Subject: [PATCH 2/2] Use name from GitHub profile as git author name --- .github/workflows/release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8e96016fdac..3136189bc27 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -71,8 +71,9 @@ jobs: # Set commit author information to the user that triggered the release workflow - name: "Set git author information" run: | + GITHUB_USER_NAME=$(gh api users/${{ github.actor }} --jq '.name') GITHUB_USER_ID=$(gh api users/${{ github.actor }} --jq '.id') - git config user.name "${{ github.actor }}" + git config user.name "${GITHUB_USER_NAME}}" git config user.email "${GITHUB_USER_ID}+${{ github.actor }}@users.noreply.github.com" # This step bumps version numbers in build.gradle and creates git artifacts for the release