From a6795d11d986f4a91fefccf44dd123b2d48372c7 Mon Sep 17 00:00:00 2001 From: sushi30 Date: Mon, 30 Mar 2026 10:29:04 +0200 Subject: [PATCH] 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 --- .github/workflows/sync-rebase.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/sync-rebase.yml b/.github/workflows/sync-rebase.yml index d761ec04e..58e916be2 100644 --- a/.github/workflows/sync-rebase.yml +++ b/.github/workflows/sync-rebase.yml @@ -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' ' ')