Skip to content

Commit 98338fe

Browse files
authored
Update sync-main.yml
1 parent 2a8c8db commit 98338fe

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

.github/workflows/sync-main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ jobs:
5858
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
5959
- name: Create or update PR
6060
run: |
61-
if ! gh pr view -R microsoft/codeql -t 'Sync Main' > /dev/null 2>&1; then
62-
gh pr create --repo microsoft/codeql --fill -B main -H sync-main-pr --title 'Sync Main' --body "This PR syncs the latest changes from \`codeql-cli/latest\` into \`main\`."
61+
if gh pr list --repo microsoft/codeql --head sync-main-pr --base main --json number --jq '.[0].number' > /dev/null; then
62+
echo "PR from sync-main-pr to main already exists. Exiting gracefully."
6363
else
64-
echo "PR 'Sync Main' already exists."
64+
gh pr create --repo microsoft/codeql --fill -B main -H sync-main-pr --title 'Sync Main' --body "This PR syncs the latest changes from \`codeql-cli/latest\` into \`main\`."
6565
fi
6666
env:
6767
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}

0 commit comments

Comments
 (0)