File tree Expand file tree Collapse file tree 3 files changed +51
-42
lines changed Expand file tree Collapse file tree 3 files changed +51
-42
lines changed Original file line number Diff line number Diff line change 1616 workflow_dispatch :
1717 merge_group :
1818
19- # Allow this workflow to be triggered by scheduled release workflows
20- workflow_run :
21- workflows : [ weekly-merge ]
22- types :
23- - completed
24-
2519env :
2620 DOTNET_VERSION : ${{ '9.0.x' }}
2721 ENABLE_DIAGNOSTICS : true
Original file line number Diff line number Diff line change 1+ name : scheduled-releases
2+
3+ on :
4+ schedule :
5+ # Runs every Wednesday at 08:00 UTC (midnight PST / 1:00 AM PDT)
6+ - cron : ' 0 8 * * 3'
7+
8+ # Allows manual triggering for convenience
9+ workflow_dispatch :
10+
11+ jobs :
12+ weekly-release :
13+ runs-on : ubuntu-latest
14+
15+ env :
16+ # Declare to satisfy linter, will be set dynamically during workflow execution
17+ PR_NUMBER : " "
18+
19+ steps :
20+ - name : Checkout repository
21+ uses : actions/checkout@v4
22+
23+ - name : Configure Git
24+ run : |
25+ git config user.name 'github-actions[bot]'
26+ git config user.email 'github-actions[bot]@users.noreply.github.com'
27+
28+ - name : Create weekly release PR
29+ shell : pwsh
30+ run : |
31+ # Create PR from main to rel/weekly, capture created URL
32+ $PR_URL = $(gh pr create `
33+ --base rel/weekly `
34+ --head main `
35+ --title "Scheduled weekly release $(Get-Date -Format 'yyyy-MM-dd')" `
36+ --body "Automated weekly release PR created by scheduled workflow." `
37+ --fill-verbose `
38+ --reviewer michael-hawker)
39+
40+ # Extract PR number from URL and set as environment variable
41+ $PR_NUMBER = $($PR_URL | Select-String -Pattern '\d+$').Matches[0].Value
42+ echo "PR_NUMBER=$PR_NUMBER" >> $env:GITHUB_ENV
43+ env :
44+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
45+
46+ - name : Enable auto-merge for the PR
47+ shell : pwsh
48+ run : |
49+ gh pr merge ${{ env.PR_NUMBER }} --auto --rebase
50+ env :
51+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments