Skip to content

Commit 779684b

Browse files
alcaeusjyemin
authored andcommitted
Attribute release commit and tag to user triggering the workflow (#1437)
1 parent cdf0b66 commit 779684b

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

.github/workflows/release.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ on:
99
required: true
1010
type: "string"
1111

12-
env:
13-
GIT_AUTHOR_EMAIL: "167856002+mongodb-dbx-release-bot[bot]@users.noreply.github.com"
14-
GIT_AUTHOR_NAME: "mongodb-dbx-release-bot[bot]"
15-
1612
jobs:
1713
prepare-release:
1814
environment: release
@@ -72,10 +68,13 @@ jobs:
7268
echo '🆕 Creating new release branch ${RELEASE_BRANCH} from ${{ github.ref_name }}' >> $GITHUB_STEP_SUMMARY
7369
git checkout -b ${RELEASE_BRANCH}
7470
71+
# Set commit author information to the user that triggered the release workflow
7572
- name: "Set git author information"
7673
run: |
77-
git config user.name "${GIT_AUTHOR_NAME}"
78-
git config user.email "${GIT_AUTHOR_EMAIL}"
74+
GITHUB_USER_NAME=$(gh api users/${{ github.actor }} --jq '.name')
75+
GITHUB_USER_ID=$(gh api users/${{ github.actor }} --jq '.id')
76+
git config user.name "${GITHUB_USER_NAME}}"
77+
git config user.email "${GITHUB_USER_ID}+${{ github.actor }}@users.noreply.github.com"
7978
8079
# This step bumps version numbers in build.gradle and creates git artifacts for the release
8180
- name: "Bump version numbers and create release tag"

0 commit comments

Comments
 (0)