File tree 4 files changed +108
-41
lines changed
4 files changed +108
-41
lines changed Original file line number Diff line number Diff line change 1
1
name : General CI Workflow
2
2
3
3
on :
4
+ push :
5
+ branches :
6
+ - " **"
7
+
4
8
pull_request :
5
9
branches :
6
- - master
10
+ - " ** "
7
11
8
12
jobs :
9
13
test-and-build :
Original file line number Diff line number Diff line change
1
+ name : Update Licenses on Dependency Changes
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - " **"
7
+ paths :
8
+ - " package.json"
9
+ - " pnpm-lock.yaml"
10
+ types :
11
+ - opened
12
+ - synchronize
13
+ - reopened
14
+
15
+ permissions :
16
+ contents : write
17
+ pull-requests : write
18
+ actions : write
19
+
20
+ jobs :
21
+ update-licenses :
22
+ runs-on : ubuntu-latest
23
+
24
+ steps :
25
+ - name : Checkout code
26
+ uses : actions/checkout@v4
27
+ with :
28
+ ref : ${{ github.event.pull_request.head.ref || 'master' }}
29
+
30
+ - name : Set up pnpm
31
+ uses : pnpm/action-setup@v4
32
+
33
+ - name : Set up Node.js
34
+ uses : actions/setup-node@v4
35
+ with :
36
+ node-version : " lts/*"
37
+ cache : pnpm
38
+
39
+ - name : Install dependencies
40
+ run : pnpm install --frozen-lockfile
41
+
42
+ - name : Generate licenses.json
43
+ run : |
44
+ pnpm add -g license-checker
45
+ license-checker --json > licenses.json
46
+
47
+ - name : Display licenses.json content
48
+ run : cat licenses.json
49
+
50
+ - name : Commit and push updated licenses
51
+ env :
52
+ GITHUB_TOKEN : ${{ secrets.PERSONAL_ACCESS_TOKEN }}
53
+ run : |
54
+ git config --global user.name "github-actions[bot]"
55
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
56
+ git add licenses.json
57
+ if ! git diff --cached --quiet; then
58
+ git commit -m "chore: Update licenses.json"
59
+ git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
60
+ git push origin HEAD:${{ github.event.pull_request.head.ref }}
61
+ else
62
+ echo "No changes to commit."
63
+ fi
Original file line number Diff line number Diff line change 23
23
"@swc/core" : " ^1.10.12" ,
24
24
"@swc/helpers" : " ^0.5.15" ,
25
25
"@types/jest" : " ^29.5.14" ,
26
- "@types/node" : " ^22.12 .0" ,
26
+ "@types/node" : " ^22.13 .0" ,
27
27
"jest" : " ^29.7.0" ,
28
28
"nodemon" : " ^3.1.9" ,
29
29
"rimraf" : " ^6.0.1" ,
You can’t perform that action at this time.
0 commit comments