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