Skip to content

Commit

Permalink
chore: configure git user directly in prerelease workflows (#11734)
Browse files Browse the repository at this point in the history
* chore: configure git user directly in prerelease workflows

* fix(security): use env variables

* fix: exit prerelease mode message
  • Loading branch information
alessbell authored Mar 26, 2024
1 parent 875b3c2 commit e412848
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 22 deletions.
20 changes: 9 additions & 11 deletions .github/workflows/change-prerelease-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,12 @@ jobs:
file: .changeset/pre.json
fields: '{"tag": "${{github.event.inputs.tag}}"}'

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Prepare for ${{ github.event.inputs.tag }} release
# must manually set these values since the defaults come from
# the workflow_dispatch event which does not contain the email
# for the user dispatching the event which breaks the CLA check
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# Commit these changes to the branch workflow is running against
branch: ${{ github.event.inputs.branch }}
- name: Commit and push changes
env:
TAG: ${{ github.event.inputs.tag }}
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add -A
git commit -m "Prepare for "$TAG" release"
git push
18 changes: 7 additions & 11 deletions .github/workflows/exit-prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,10 @@ jobs:
- name: Remove pre.json
run: npx rimraf .changeset/pre.json

- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Exit prerelease mode
# must manually set these values since the defaults come from
# the workflow_dispatch event which does not contain the email
# for the user dispatching the event which breaks the CLA check
commit_user_name: github-actions[bot]
commit_user_email: 41898282+github-actions[bot]@users.noreply.github.com
commit_author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
# Commit these changes to the branch workflow is running against
branch: ${{ github.event.inputs.branch }}
- name: Commit and push changes
run: |
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git add -A
git commit -m "Exit prerelease mode"
git push

0 comments on commit e412848

Please # to comment.