File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -72,13 +72,17 @@ jobs:
72
72
if [ -n "$pr_number" ]; then
73
73
echo "PR from auto/sync-main-pr to main already exists (PR #$pr_number). Exiting gracefully."
74
74
else
75
- echo "PR does not exist. Creating one..."
76
- gh pr create --repo microsoft/codeql --fill -B main -H auto/sync-main-pr \
77
- --label 'autogenerated' \
78
- --title 'Sync Main (autogenerated)' \
79
- --body "This PR syncs the latest changes from \`codeql-cli/latest\` into \`main\`." \
80
- --reviewer 'MathiasVP'
81
- --reviewer 'ropwareJB'
75
+ if git fetch origin main auto/sync-main-pr && [ -n "$(git rev-list origin/main..origin/auto/sync-main-pr)" ]; then
76
+ echo "PR does not exist. Creating one..."
77
+ gh pr create --repo microsoft/codeql --fill -B main -H auto/sync-main-pr \
78
+ --label 'autogenerated' \
79
+ --title 'Sync Main (autogenerated)' \
80
+ --body "This PR syncs the latest changes from \`codeql-cli/latest\` into \`main\`." \
81
+ --reviewer 'MathiasVP'
82
+ --reviewer 'ropwareJB'
83
+ else
84
+ echo "No changes to sync from auto/sync-main-pr to main. Exiting gracefully."
85
+ fi
82
86
fi
83
87
env :
84
88
GH_TOKEN : ${{ secrets.WORKFLOW_TOKEN }}
You can’t perform that action at this time.
0 commit comments