ci: stash rendered formula before checkout in source-repo commit step

`git checkout main` aborted on the v0.2.0 release because the
freshly-rendered Formula/dsmview.rb differed from the committed
version. Save it to /tmp first, then force-checkout main, then
restore. Release tap-push step already succeeded, so brew install
worked — only the back-commit refresh was missed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jan Vetesnik 2026-06-13 18:02:07 +02:00
parent b266bcb605
commit 367804f681

View file

@ -155,11 +155,14 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Stash the newly rendered formula before switching branches —
# otherwise `git checkout main` aborts when the working-tree
# formula differs from main's committed version.
cp Formula/dsmview.rb /tmp/dsmview.rb
git config user.email "github-actions[bot]@users.noreply.github.com"
git config user.name "github-actions[bot]"
git fetch origin main
git checkout main
cp Formula/dsmview.rb /tmp/dsmview.rb
git checkout -f main
git pull --rebase origin main || true
cp /tmp/dsmview.rb Formula/dsmview.rb
git add Formula/dsmview.rb