Skip to content

Commit

Permalink
Merge pull request #163 from Homebrew/sync-shared-config-force-push-o…
Browse files Browse the repository at this point in the history
…nly-when-needed

workflows/sync-shared-config: only force push if there are changes
  • Loading branch information
ZhongRuoyu committed Jul 15, 2024
2 parents 564eb38 + 0e49cac commit 701a449
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/sync-shared-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ jobs:
cd target/${{ matrix.repo }}
git checkout -b sync-shared-config
git push --set-upstream --force origin sync-shared-config
if gh api \
-X GET \
Expand All @@ -120,7 +119,14 @@ jobs:
-f state=open |
jq --exit-status 'length == 0'
then
git push --set-upstream --force origin sync-shared-config
gh pr create --head sync-shared-config --title "Synchronize shared configuration" --body 'This pull request was created automatically by the [`sync-shared-config`](https://github.com/Homebrew/.github/blob/HEAD/.github/actions/sync/shared-config.rb) workflow.'
else
git fetch origin sync-shared-config
if ! git diff --no-ext-diff --quiet --exit-code origin/sync-shared-config
then
git push --force origin sync-shared-config
fi
fi
env:
GH_REPO: ${{ matrix.repo }}
Expand Down

0 comments on commit 701a449

Please sign in to comment.