Skip to content

Commit f33057f

Browse files
authored
Merge pull request #700 from CommunityToolkit/fix/scheduled-releases-fill-verbose
Fix --fill-verbose parameter conflict in scheduled releases workflow
2 parents 6316342 + c231675 commit f33057f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/scheduled-releases.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
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
@@ -46,6 +54,7 @@ jobs:
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

0 commit comments

Comments
 (0)