Skip to content

Commit 2a8c8db

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

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

.github/workflows/sync-main.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ jobs:
4545
git remote add upstream https://github.com/github/codeql.git
4646
git fetch upstream --tags --force
4747
echo "::endgroup::"
48-
4948
echo "::group::Merge codeql-cli/latest"
5049
set -x
5150
git merge codeql-cli/latest
@@ -59,8 +58,11 @@ jobs:
5958
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
6059
- name: Create or update PR
6160
run: |
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\`."
63-
exit 0
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\`."
63+
else
64+
echo "PR 'Sync Main' already exists."
65+
fi
6466
env:
6567
GH_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}
6668
GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }}

0 commit comments

Comments
 (0)