-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (40 loc) · 1.37 KB
/
upgrade.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
name: Upgrade Dependencies
on:
schedule:
- cron: '1 0 * * 0'
workflow_dispatch:
jobs:
yarn-upgrade:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'yarn'
- name: Install Yarn
run: npm install -g yarn
- name: Setup git and create branch
env:
GITHUB_TOKEN: ${{ secrets.G_TOKEN }}
run: |
git config --global user.name "Raajheer1"
git config --global user.email "[email protected]"
git checkout -b chore/upgrade-dependencies-$(date +%Y-%m-%d)
git push --set-upstream origin chore/upgrade-dependencies-$(date +%Y-%m-%d)
- name: Upgrade dependencies
run: yarn upgrade --latest
- name: Lint fix
run: yarn lint:fix
- name: Commit and push changes
env:
GITHUB_TOKEN: ${{ secrets.G_TOKEN }}
run: |
git add .
git commit -m "chore: upgrade dependencies"
git push
- name: Create PR
env:
GITHUB_TOKEN: ${{ secrets.G_TOKEN }}
run: |
gh pr create -t "Chore: Upgrade Dependencies" -B master -H chore/upgrade-dependencies-$(date +%Y-%m-%d) --body "Weekly automated PR to upgrade dependencies using \`yarn upgrade --latest\`. Please verify the changes and merge."