Skip to content

Commit

Permalink
Attribute release commit and tag to user triggering the workflow (#1437)
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus authored and jyemin committed Sep 4, 2024
1 parent cdf0b66 commit 779684b
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 779684b

Please sign in to comment.