Skip to content

Commit 544f0ca

Browse files
authored
Update sync-main.yml
1 parent 7a168b0 commit 544f0ca

File tree

1 file changed

+12
-38
lines changed

1 file changed

+12
-38
lines changed

.github/workflows/sync-main.yml

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -51,48 +51,22 @@ jobs:
5151
echo "::endgroup::"
5252
- name: Push sync branch and ensure visibility
5353
run: |
54-
git status
55-
echo "yo1"
5654
git push origin sync-main-pr
57-
echo "yo2"
58-
59-
BRANCH_NAME="sync-main-pr"
60-
COMMIT_SHA=$(git rev-parse HEAD)
61-
MAX_RETRIES=12
62-
SLEEP_SECONDS=5
63-
64-
echo "🔄 Waiting for commit $COMMIT_SHA to be visible on GitHub..."
65-
for (( i=1; i<=MAX_RETRIES; i++ )); do
66-
if gh api "repos/:owner/:repo/commits/$COMMIT_SHA" > /dev/null 2>&1; then
67-
echo "✅ Commit is now visible on GitHub."
68-
break
69-
else
70-
echo "⏳ Attempt $i: Commit not visible yet — sleeping ${SLEEP_SECONDS}s"
71-
sleep $SLEEP_SECONDS
72-
fi
73-
done
74-
if (( i > MAX_RETRIES )); then
75-
echo "❌ Commit $COMMIT_SHA never became visible after $((MAX_RETRIES * SLEEP_SECONDS)) seconds."
76-
exit 1
77-
fi
78-
79-
echo "🔄 Waiting for branch '$BRANCH_NAME' to be visible on GitHub..."
80-
for (( i=1; i<=MAX_RETRIES; i++ )); do
81-
if git ls-remote --exit-code origin "refs/heads/$BRANCH_NAME" > /dev/null 2>&1; then
82-
echo "✅ Branch is now visible on GitHub."
83-
break
84-
else
85-
echo "⏳ Attempt $i: Branch not visible yet — sleeping ${SLEEP_SECONDS}s"
86-
sleep $SLEEP_SECONDS
87-
fi
88-
done
89-
if (( i > MAX_RETRIES )); then
90-
echo "❌ Branch '$BRANCH_NAME' never became visible after $((MAX_RETRIES * SLEEP_SECONDS)) seconds."
91-
exit 1
92-
fi
9355
env:
9456
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
9557
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
58+
- name: Debug sync-main-pr state
59+
run: |
60+
echo "🔍 Checking sync-main-pr branch and its commit history"
61+
git status
62+
echo "Commits on sync-main-pr:"
63+
git log --oneline sync-main-pr
64+
echo "Commits on main:"
65+
git log --oneline main
66+
echo "Diff between sync-main-pr and main:"
67+
git diff main..sync-main-pr
68+
echo "Current SHA for main: $(git rev-parse main)"
69+
echo "Current SHA for sync-main-pr: $(git rev-parse sync-main-pr)"
9670
- name: Create or update PR
9771
run: |
9872
gh pr create --fill -B main -H sync-main-pr --title 'Sync Main' --body "This PR syncs the latest changes from \`codeql-cli/latest\` into \`main\`."

0 commit comments

Comments
 (0)