Skip to content

Commit 5367795

Browse files
Generate licenses.json via GitHub Actions after dependency updates (#38) (#43)
* Generate license.json via GitHub Actions after deps updates (#38) * chore: Update licenses.json --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent 259e4be commit 5367795

File tree

5 files changed

+209
-41
lines changed

5 files changed

+209
-41
lines changed

.github/workflows/general-ci.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
name: General CI Workflow
22

33
on:
4+
push:
5+
branches:
6+
- "**"
7+
48
pull_request:
59
branches:
6-
- master
10+
- "**"
711

812
jobs:
913
test-and-build:

.github/workflows/update-licenses.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
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+
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
30+
31+
- name: Set up pnpm
32+
uses: pnpm/action-setup@v4
33+
34+
- name: Set up Node.js
35+
uses: actions/setup-node@v4
36+
with:
37+
node-version: "lts/*"
38+
cache: pnpm
39+
40+
- name: Install dependencies
41+
run: pnpm install --frozen-lockfile
42+
43+
- name: Generate licenses.json
44+
run: |
45+
pnpm add -g license-checker
46+
license-checker --json > licenses.json
47+
48+
- name: Display licenses.json content
49+
run: cat licenses.json
50+
51+
- name: Commit and push updated licenses
52+
env:
53+
GITHUB_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
54+
run: |
55+
git config --global user.name "github-actions[bot]"
56+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
57+
git add licenses.json
58+
if ! git diff --cached --quiet; then
59+
git commit -m "chore: Update licenses.json"
60+
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
61+
git push origin HEAD:${{ github.event.pull_request.head.ref }}
62+
else
63+
echo "No changes to commit."
64+
fi

licenses.json

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"@swc-node/[email protected]": {
3+
"licenses": "MIT",
4+
"repository": "https://github.com/swc-project/swc-node",
5+
"publisher": "LongYinan",
6+
"email": "[email protected]",
7+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@swc-node/jest",
8+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@swc-node/jest/LICENSE"
9+
},
10+
"@swc-node/[email protected]": {
11+
"licenses": "MIT",
12+
"repository": "https://github.com/swc-project/swc-node",
13+
"publisher": "LongYinan",
14+
"email": "[email protected]",
15+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@swc-node/register",
16+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@swc-node/register/LICENSE"
17+
},
18+
19+
"licenses": "MIT",
20+
"repository": "https://github.com/swc-project/pkgs",
21+
"publisher": "강동윤",
22+
"email": "[email protected]",
23+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@swc/cli",
24+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@swc/cli/LICENSE"
25+
},
26+
27+
"licenses": "Apache-2.0",
28+
"repository": "https://github.com/swc-project/swc",
29+
"publisher": "강동윤",
30+
"email": "[email protected]",
31+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@swc/core"
32+
},
33+
34+
"licenses": "Apache-2.0",
35+
"repository": "https://github.com/swc-project/swc",
36+
"publisher": "강동윤",
37+
"email": "[email protected]",
38+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@swc/helpers",
39+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@swc/helpers/LICENSE"
40+
},
41+
"@types/[email protected]": {
42+
"licenses": "MIT",
43+
"repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
44+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@types/jest",
45+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@types/jest/LICENSE"
46+
},
47+
"@types/[email protected]": {
48+
"licenses": "MIT",
49+
"repository": "https://github.com/DefinitelyTyped/DefinitelyTyped",
50+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@types/node",
51+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/@types/node/LICENSE"
52+
},
53+
54+
"licenses": "MIT",
55+
"publisher": "@mattfsourcecode",
56+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server",
57+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/LICENSE"
58+
},
59+
60+
"licenses": "MIT",
61+
"repository": "https://github.com/fastify/fastify",
62+
"publisher": "Matteo Collina",
63+
"email": "[email protected]",
64+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/fastify",
65+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/fastify/LICENSE"
66+
},
67+
68+
"licenses": "MIT",
69+
"repository": "https://github.com/jestjs/jest",
70+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/jest",
71+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/jest/LICENSE"
72+
},
73+
74+
"licenses": "MIT",
75+
"repository": "https://github.com/remy/nodemon",
76+
"publisher": "Remy Sharp",
77+
"url": "https://github.com/remy",
78+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/nodemon",
79+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/nodemon/LICENSE"
80+
},
81+
82+
"licenses": "ISC",
83+
"repository": "https://github.com/isaacs/rimraf",
84+
"publisher": "Isaac Z. Schlueter",
85+
"email": "[email protected]",
86+
"url": "http://blog.izs.me/",
87+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/rimraf",
88+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/rimraf/LICENSE"
89+
},
90+
91+
"licenses": "MIT",
92+
"repository": "https://github.com/TypeStrong/ts-node",
93+
"publisher": "Blake Embrey",
94+
"email": "[email protected]",
95+
"url": "http://blakeembrey.me",
96+
"path": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/ts-node",
97+
"licenseFile": "/home/runner/work/fastify-swc-typescript-server/fastify-swc-typescript-server/node_modules/ts-node/LICENSE"
98+
}
99+
}
100+

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"@swc/core": "^1.10.12",
2424
"@swc/helpers": "^0.5.15",
2525
"@types/jest": "^29.5.14",
26-
"@types/node": "^22.12.0",
26+
"@types/node": "^22.13.0",
2727
"jest": "^29.7.0",
2828
"nodemon": "^3.1.9",
2929
"rimraf": "^6.0.1",

0 commit comments

Comments
 (0)