diff options
| author | Takashi Kokubun <takashikkbn@gmail.com> | 2025-10-06 14:08:03 -0700 |
|---|---|---|
| committer | Takashi Kokubun <takashikkbn@gmail.com> | 2025-10-06 14:08:04 -0700 |
| commit | bc8732b6c81c761a6ed693effb0f497f39f43ea3 (patch) | |
| tree | 0751d90f525e2f95336082163093dd2c27d9ff7c | |
| parent | 6c1b5887149e731906e003af6fc8bfc1bc112c28 (diff) | |
sync_default_gems.yml: Attempt push only if needed
| -rw-r--r-- | .github/workflows/sync_default_gems.yml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/.github/workflows/sync_default_gems.yml b/.github/workflows/sync_default_gems.yml index 301a59e396..211d75dcf7 100644 --- a/.github/workflows/sync_default_gems.yml +++ b/.github/workflows/sync_default_gems.yml @@ -43,7 +43,14 @@ jobs: run: git config merge.renameLimit 999999 - name: Run tool/sync_default_gems.rb - run: ruby tool/sync_default_gems.rb "${gem_name}" "${gem_before}..${gem_after}" + id: sync + run: | + ruby_before=$(git rev-parse HEAD) + set -x + ruby tool/sync_default_gems.rb "${gem_name}" "${gem_before}..${gem_after}" + if [[ "$(git rev-parse HEAD)" != "$ruby_before" ]]; then + echo update=true >> $GITHUB_OUTPUT + fi env: gem_name: ${{ github.event.client_payload.gem || github.event.inputs.gem }} gem_before: ${{ github.event.client_payload.before || github.event.inputs.before }} @@ -56,6 +63,7 @@ jobs: run: | git pull --ff-only origin ${GITHUB_REF#refs/heads/} git push origin ${GITHUB_REF#refs/heads/} + if: ${{ steps.sync.outputs.update }} - uses: ./.github/actions/slack with: |
