Skip to content

Commit c1665fd

Browse files
authored
Update sync-main.yml
1 parent db6d82c commit c1665fd

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

.github/workflows/sync-main.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,15 @@ jobs:
4848
echo "::endgroup::"
4949
- name: Push sync branch
5050
run: |
51+
echo "$GITHUB_TOKEN" | gh auth login --with-token
5152
git push origin sync-main-pr --force
5253
# Ensure branch is visible to GitHub
53-
gh api repos/:owner/:repo/branches/sync-main-pr || {
54+
gh api repos/:owner/:repo/commits/$(git rev-parse HEAD) || {
5455
echo "Branch not yet visible to GitHub — waiting a bit more"
5556
sleep 10
5657
}
5758
git branch
58-
gh api repos/:owner/:repo/branches/sync-main-pr || {
59+
gh api repos/:owner/:repo/commits/$(git rev-parse HEAD) || {
5960
echo "Branch not yet visible to GitHub — waiting a bit more"
6061
sleep 10
6162
}
@@ -65,12 +66,12 @@ jobs:
6566
- name: Create or update PR
6667
run: |
6768
git branch
68-
gh api repos/:owner/:repo/branches/sync-main-pr || {
69+
gh api repos/:owner/:repo/commits/$(git rev-parse HEAD) || {
6970
echo "Branch not yet visible to GitHub — waiting a bit more"
7071
sleep 10
7172
}
7273
git branch
73-
gh api repos/:owner/:repo/branches/sync-main-pr
74+
gh api repos/:owner/:repo/commits/$(git rev-parse HEAD)
7475
PR_URL=$(gh pr list --head sync-main-pr --json url --jq '.[0].url')
7576
if [ -z "$PR_URL" ]; then
7677
gh pr create \

0 commit comments

Comments
 (0)