Skip to content

Commit 4ae6ef1

Browse files
surenderssmCopilot
andauthored
Fix auto-update workflow: PAT token, weekly schedule, all option (#2912)
* Use PAT token for PR creation in auto-update workflow GitHub Actions default token is not permitted to create PRs in this org. Use a PAT secret instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add 'all' option to manual workflow trigger Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Add month name to auto-update PR title Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Run auto-update weekly on Wednesdays instead of daily Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix auto-update workflow: PAT token, weekly schedule, all option - Use STACK_UPDATE_PAT for PR creation (org restricts default token) - Run weekly on Wednesdays at 5:30 AM IST - Add 'all' option to manual trigger - Add month name to PR title Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 06d3caf commit 4ae6ef1

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

.github/workflows/auto-stack-update.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ name: Auto Stack Update
22

33
on:
44
schedule:
5-
- cron: '30 0 * * *'
5+
- cron: '0 0 * * 3'
66
workflow_dispatch:
77
inputs:
88
stack:
99
type: choice
1010
description: 'Stack to update'
1111
options:
12+
- all
1213
- node
1314
- python
1415
- php
@@ -19,7 +20,7 @@ jobs:
1920
strategy:
2021
fail-fast: false
2122
matrix:
22-
stack: ${{ github.event_name == 'workflow_dispatch' && fromJSON(format('["{0}"]', inputs.stack)) || fromJSON('["node","python","php","dotnet"]') }}
23+
stack: ${{ github.event_name == 'workflow_dispatch' && inputs.stack != 'all' && fromJSON(format('["{0}"]', inputs.stack)) || fromJSON('["node","python","php","dotnet"]') }}
2324
runs-on: ubuntu-latest
2425
permissions:
2526
contents: write
@@ -36,11 +37,16 @@ jobs:
3637
run: |
3738
python .github/auto-update/auto-update-stack.py --stack ${{ matrix.stack }}
3839
40+
- name: Get month name
41+
id: month
42+
run: echo "name=$(date +'%B %Y')" >> $GITHUB_OUTPUT
43+
3944
- name: Create Pull Request
4045
if: steps.check.outputs.no_updates != 'true'
4146
uses: peter-evans/create-pull-request@v6
4247
with:
43-
title: "[${{ matrix.stack }}] Update: ${{ steps.check.outputs.summary }}"
48+
token: ${{ secrets.STACK_UPDATE_PAT }}
49+
title: "[${{ steps.month.outputs.name }}][${{ matrix.stack }}] Update: ${{ steps.check.outputs.summary }}"
4450
branch: auto-update/${{ matrix.stack }}
4551
commit-message: "Update ${{ matrix.stack }} to latest upstream version"
4652
body: |

0 commit comments

Comments
 (0)