File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Dependencies upgrade
2+
3+ on :
4+ workflow_dispatch :
5+ schedule :
6+ - cron : " 0 0 1 * *" # Runs every 1st day of month at midnight UTC
7+
8+ permissions :
9+ contents : write # Grants write access to push changes
10+ pull-requests : write # and create PRs
11+
12+ jobs :
13+ run-bash-and-pr :
14+ runs-on : ubuntu-latest
15+
16+ steps :
17+ - name : Checkout repository
18+ uses : actions/checkout@v4
19+
20+ - uses : actions/setup-node@v4
21+ with :
22+ node-version : 20
23+
24+ - name : Install dependencies
25+ run : yarn install
26+
27+ - name : Upgrade dependencies
28+ run : |
29+ yarn workspace express-zod-api upgrade
30+ git checkout -- express-zod-api/package.json
31+ yarn install
32+
33+ - name : Branch name
34+ id : create-branch
35+ if : steps.git-state.outputs.changes == 'true'
36+ run : |
37+ BRANCH_NAME="deps-$(date +%Y-%m-%d)"
38+ echo "branch-name=$BRANCH_NAME" >> $GITHUB_OUTPUT
39+
40+ - name : Create a pull request
41+ if : steps.git-state.outputs.changes == 'true'
42+ uses : peter-evans/create-pull-request@v5
43+ with :
44+ base : master
45+ branch : ${{ steps.create-branch.outputs.branch-name }}
46+ commit-message : " Upgrading all dependencies"
47+ title : " Upgrading all dependencies"
48+ body : " This PR contains automated updates generated by the monthly workflow."
49+ delete-branch : false
You can’t perform that action at this time.
0 commit comments