Skip to content

Commit

Permalink
Only push changes back to the branch from one of the matrix jobs
Browse files Browse the repository at this point in the history
  • Loading branch information
knightjoel committed Nov 27, 2023
1 parent 20c1463 commit bc9c3f5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
arch: x86-64
version: "7.4"
host: macos-12
do-git-push: true # Push changes from this build back to the branch
- name: 7.4/arm64
arch: arm64
version: "7.4"
Expand Down Expand Up @@ -92,8 +93,11 @@ jobs:
git status --porcelain
echo "modified=$(if [ -n "$(git status --porcelain)" ]; then echo "true"; else echo "false"; fi)" >> $GITHUB_OUTPUT
- name: Push changes back to branch
if: steps.git-check.outputs.modified == 'true'
- name: Push changes back to the branch
# It's important changes are only pushed back to the branch once within
# all the runs of the matrix, otherwise they will try to push on top of
# each other and error out.
if: steps.git-check.outputs.modified == 'true' && matrix.os.do-git-push
run: |
git config --global user.name 'Joel[bot]'
git config --global user.email '17298529+knightjoel@users.noreply.github.com'
Expand Down

0 comments on commit bc9c3f5

Please sign in to comment.