Skip to content

Commit 31673fb

Browse files
chore: Automatic modules update via CICD
1 parent 2e7293f commit 31673fb

File tree

2 files changed

+59
-1
lines changed

2 files changed

+59
-1
lines changed

.github/workflows/pull-request.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
name: Pull Request CI
1+
name: Pull Request CI check
22

33
on:
4+
workflow_dispatch:
45
pull_request:
56
branches:
67
- main
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Update NPM Packages
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * 0"
6+
workflow_dispatch:
7+
8+
env:
9+
node_version: 20
10+
11+
jobs:
12+
update-packages:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: ${{ env.node_version }}
22+
cache: "npm"
23+
24+
- name: Install npm-check-updates
25+
run: npm install -g npm-check-updates
26+
27+
- name: Update packages in each package.json
28+
run: |
29+
package_files=$(find . -name 'package.json' -not -path '*/node_modules/*')
30+
for file in $package_files; do
31+
dir=$(dirname "$file")
32+
echo "Updating packages in $dir"
33+
(cd "$dir" && ncu -u)
34+
done
35+
36+
- name: Install updated packages in root
37+
run: npm install --force
38+
39+
- name: Commit updated package.json files
40+
run: |
41+
git config --global user.name "GitHub Actions"
42+
git config --global user.email "[email protected]"
43+
git add .
44+
git commit -m "fix: Update dependencies" --no-verify || true
45+
46+
- name: Create Pull Request
47+
uses: peter-evans/create-pull-request@v6
48+
with:
49+
token: ${{ secrets.PRIVATE_GITHUB_TOKEN }}
50+
commit-message: "fix: Update dependencies"
51+
title: "fix: Update NPM dependencies"
52+
body: "This is an auto-generated PR with dependency updates."
53+
branch: "fix/update-dependencies"
54+
delete-branch: true
55+
56+
- name: Check output
57+
run: echo "Pull Request Number - ${{ steps.create-pull-request.outputs.pull-request-number }}"

0 commit comments

Comments
 (0)