Skip to content

Commit 97d032b

Browse files
committed
Dependencies upgrading workflow.
1 parent 0f51e72 commit 97d032b

1 file changed

Lines changed: 49 additions & 0 deletions

File tree

.github/workflows/dependencies.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
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

0 commit comments

Comments
 (0)