Skip to content

Commit bc8732b

Browse files
committed
sync_default_gems.yml: Attempt push only if needed
1 parent 6c1b588 commit bc8732b

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

.github/workflows/sync_default_gems.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,14 @@ jobs:
4343
run: git config merge.renameLimit 999999
4444

4545
- name: Run tool/sync_default_gems.rb
46-
run: ruby tool/sync_default_gems.rb "${gem_name}" "${gem_before}..${gem_after}"
46+
id: sync
47+
run: |
48+
ruby_before=$(git rev-parse HEAD)
49+
set -x
50+
ruby tool/sync_default_gems.rb "${gem_name}" "${gem_before}..${gem_after}"
51+
if [[ "$(git rev-parse HEAD)" != "$ruby_before" ]]; then
52+
echo update=true >> $GITHUB_OUTPUT
53+
fi
4754
env:
4855
gem_name: ${{ github.event.client_payload.gem || github.event.inputs.gem }}
4956
gem_before: ${{ github.event.client_payload.before || github.event.inputs.before }}
@@ -56,6 +63,7 @@ jobs:
5663
run: |
5764
git pull --ff-only origin ${GITHUB_REF#refs/heads/}
5865
git push origin ${GITHUB_REF#refs/heads/}
66+
if: ${{ steps.sync.outputs.update }}
5967

6068
- uses: ./.github/actions/slack
6169
with:

0 commit comments

Comments
 (0)