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:
parent
a818bcabd0
commit
a6795d11d9
1 changed files with 2 additions and 5 deletions
7
.github/workflows/sync-rebase.yml
vendored
7
.github/workflows/sync-rebase.yml
vendored
|
|
@ -35,16 +35,13 @@ jobs:
|
||||||
git fetch origin
|
git fetch origin
|
||||||
|
|
||||||
- name: Sync main from upstream
|
- name: Sync main from upstream
|
||||||
run: |
|
run: git push origin upstream/main:main
|
||||||
git checkout main
|
|
||||||
git reset --hard upstream/main
|
|
||||||
git push origin main
|
|
||||||
|
|
||||||
- name: Attempt rebase of sushi30 onto main
|
- name: Attempt rebase of sushi30 onto main
|
||||||
id: rebase
|
id: rebase
|
||||||
run: |
|
run: |
|
||||||
git checkout -b sushi30 origin/sushi30
|
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"
|
echo "status=success" >> "$GITHUB_OUTPUT"
|
||||||
else
|
else
|
||||||
CONFLICTS=$(git diff --name-only --diff-filter=U | tr '\n' ' ')
|
CONFLICTS=$(git diff --name-only --diff-filter=U | tr '\n' ' ')
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue