sync_default_gems.yml: Pull --rebase before push

It was supposed to update a local branch in case the remote branch was
updated between actions/checkout and the end of tool/sync_default_gems.rb.

Note that this `git pull` didn't exist in the original bin/update-default-gem.sh
d9e9bcc60d,
so it was newly introduced at 3ba5cfd1cb.

But `git pull --no-ff` failed when master had updates in an unrelated
repository. I think we need to use `git pull --rebase` instead.

This fixes:

* https://github.com/ruby/ruby/actions/runs/19207693793/job/54905403070
    * checkout: f08030e9dccf38d9ea5c9505203fe26484dc28d8
    * ruby tool/sync_default_gems.rb net-http ec9c70a6fba75a63c128864ef3cb32c883665a33..e4d80bd609f22cad04a2e2c1d54c981bb853c938
    * pull: 2bf82c627494e785737037bbaf9a6b98f3c6354c
This commit is contained in:
Takashi Kokubun 2025-11-09 09:54:41 -08:00
parent f1b1899a74
commit 17efb770c8

View File

@ -56,7 +56,7 @@ jobs:
- name: Push
run: |
git pull --ff-only origin ${GITHUB_REF#refs/heads/}
git pull --rebase origin ${GITHUB_REF#refs/heads/}
git push origin ${GITHUB_REF#refs/heads/}
if: ${{ steps.sync.outputs.update }}