fix(ci): avoid ambiguous 'main' checkout when both origin and upstream have main branch

Replace checkout+reset+push with a direct refspec push (upstream/main:main),
and use the full refs/remotes/origin/main ref for the rebase to prevent
ambiguity when both remotes have a branch named main.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
sushi30 2026-03-30 10:29:04 +02:00 committed by github-actions[bot]
parent a818bcabd0
commit a6795d11d9

View file

@ -35,16 +35,13 @@ jobs:
git fetch origin
- name: Sync main from upstream
run: |
git checkout main
git reset --hard upstream/main
git push origin main
run: git push origin upstream/main:main
- name: Attempt rebase of sushi30 onto main
id: rebase
run: |
git checkout -b sushi30 origin/sushi30
if git rebase origin/main; then
if git rebase refs/remotes/origin/main; then
echo "status=success" >> "$GITHUB_OUTPUT"
else
CONFLICTS=$(git diff --name-only --diff-filter=U | tr '\n' ' ')