-
Notifications
You must be signed in to change notification settings - Fork 13
58 lines (53 loc) · 2.37 KB
/
Update Yonode Package.yml
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: Update Yonode Templates Every 5 Minutes
on:
schedule:
- cron: '*/5 * * * *'
jobs:
update-templates:
runs-on: ubuntu-latest
strategy:
matrix:
template: [
'JS-MongoDB-Mongoose-Auth-Template', 'JS-MongoDB-Mongoose-NoAuth-Template',
'JS-MongoDB-Prisma-Auth-Template', 'JS-MongoDB-Prisma-NoAuth-Template',
'JS-MongoDB-TypeORM-Auth-Template', 'JS-MongoDB-TypeORM-NoAuth-Template',
'JS-MySQL-Prisma-Auth-Template', 'JS-MySQL-Prisma-NoAuth-Template',
'JS-MySQL-Sequelize-Auth-Template', 'JS-MySQL-Sequelize-NoAuth-Template',
'JS-MySQL-TypeORM-Auth-Template', 'JS-MySQL-TypeORM-NoAuth-Template',
'JS-NoDB-Template', 'JS-PostgreSQL-Prisma-Auth-Template',
'JS-PostgreSQL-Prisma-NoAuth-Template', 'JS-PostgreSQL-Sequelize-Auth-Template',
'JS-PostgreSQL-Sequelize-NoAuth-Template', 'JS-PostgreSQL-TypeORM-Auth-Template',
'JS-PostgreSQL-TypeORM-NoAuth-Template'
]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Change directory and update packages
run: |
cd packages/yonode-templates/${{ matrix.template }}
npm install -g npm-check-updates
ncu -u
if [ -n "$(git status --porcelain)" ]; then
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git checkout -b update-${{ matrix.template }}-dependencies
git commit -am "Update dependencies for ${{ matrix.template }}"
git push origin update-${{ matrix.template }}-dependencies
echo "Changes committed and new branch pushed."
else
echo "No updates found for ${{ matrix.template }}"
fi
- name: Create Pull Request for updated package.json
uses: peter-evans/create-pull-request@v4
with:
commit-message: Update dependencies in ${{ matrix.template }}
title: 'Update dependencies for ${{ matrix.template }}'
body: 'This pull request updates dependencies for ${{ matrix.template }}.'
branch: update-${{ matrix.template }}-dependencies
base: 'main'
labels: 'dependencies'
token: ${{ secrets.GITHUB_TOKEN }}