From 779684be541250a35b90984956be3f20215d9fbc Mon Sep 17 00:00:00 2001 From: Andreas Braun Date: Tue, 9 Jul 2024 22:17:36 +0200 Subject: [PATCH] Attribute release commit and tag to user triggering the workflow (#1437) --- .github/workflows/release.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 0832b079955..3136189bc27 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,13 @@ 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_NAME=$(gh api users/${{ github.actor }} --jq '.name') + GITHUB_USER_ID=$(gh api users/${{ github.actor }} --jq '.id') + 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 - name: "Bump version numbers and create release tag"