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