File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 1515 env :
1616 # Declare to satisfy linter, will be set dynamically during workflow execution
1717 PR_NUMBER : " "
18+ HAS_NEW_COMMITS : " "
1819
1920 steps :
2021 - name : Checkout repository
@@ -27,15 +28,22 @@ jobs:
2728 git config user.name 'github-actions[bot]'
2829 git config user.email 'github-actions[bot]@users.noreply.github.com'
2930
31+ - name : Check for new commits
32+ shell : pwsh
33+ run : |
34+ # Check if there are commits between rel/weekly and main
35+ $commitCount = git rev-list --count rel/weekly..main
36+ echo "HAS_NEW_COMMITS=$($commitCount -gt 0)" >> $env:GITHUB_ENV
37+
3038 - name : Create weekly release PR
39+ if : ${{ env.HAS_NEW_COMMITS == 'true' }}
3140 shell : pwsh
3241 run : |
3342 # Create PR from main to rel/weekly, capture created URL
3443 $PR_URL = $(gh pr create `
3544 --base rel/weekly `
3645 --head main `
3746 --title "Scheduled weekly release $(Get-Date -Format 'yyyy-MM-dd')" `
38- --body "Automated weekly release PR created by scheduled workflow." `
3947 --fill-verbose `
4048 --reviewer michael-hawker)
4149
4654 GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
4755
4856 - name : Enable auto-merge for the PR
57+ if : ${{ env.HAS_NEW_COMMITS == 'true' }}
4958 shell : pwsh
5059 run : |
5160 gh pr merge ${{ env.PR_NUMBER }} --auto --rebase
You can’t perform that action at this time.
0 commit comments