File tree Expand file tree Collapse file tree 3 files changed +102
-40
lines changed Expand file tree Collapse file tree 3 files changed +102
-40
lines changed 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
+ - master
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
+
19
+ jobs :
20
+ update-licenses :
21
+ runs-on : ubuntu-latest
22
+
23
+ steps :
24
+ - name : Checkout code
25
+ uses : actions/checkout@v4
26
+ with :
27
+ ref : ${{ github.event.pull_request.head.ref || 'master' }}
28
+
29
+ - name : Set up pnpm
30
+ uses : pnpm/action-setup@v4
31
+
32
+ - name : Set up Node.js
33
+ uses : actions/setup-node@v4
34
+ with :
35
+ node-version : " lts/*"
36
+ cache : pnpm
37
+
38
+ - name : Install dependencies
39
+ run : pnpm install --frozen-lockfile
40
+
41
+ - name : Generate licenses.json
42
+ run : |
43
+ pnpm add -g license-checker
44
+ license-checker --json > licenses.json
45
+
46
+ - name : Display licenses.json content
47
+ run : cat licenses.json
48
+
49
+ - name : Commit and push updated licenses
50
+ env :
51
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
52
+ run : |
53
+ git config --global user.name "github-actions[bot]"
54
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
55
+ git add licenses.json
56
+ if ! git diff --cached --quiet; then
57
+ git commit -m "chore: Update licenses.json"
58
+ git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
59
+ git push origin HEAD:${{ github.event.pull_request.head.ref || 'master' }}
60
+ else
61
+ echo "No changes to commit."
62
+ 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