Skip to content

Commit e2e132e

Browse files
Add 3PP license check as part of PR CI
The license check can be triggered locally: yarn license:check For automatic opening of IP tickets for suspicious depedencies, set an Eclipse Foundation gitlab token as environment variable "DASH_TOKEN" and run the alternate pacakge.json script. e.g.: export DASH_TOKEN="<your token>" yarn license:check:reviewAdd 3PP license check as part of PR CI Closes #268 Signed-off-by: Marc Dumais <[email protected]>
1 parent 93cc807 commit e2e132e

File tree

5 files changed

+70
-1
lines changed

5 files changed

+70
-1
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: 3PP License Check
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
pull_request:
9+
branches:
10+
- master
11+
schedule:
12+
- cron: '0 4 * * *' # Runs every day at 4am: https://docs.github.com/en/actions/reference/events-that-trigger-workflows#scheduled-events-schedule
13+
14+
jobs:
15+
16+
License-check:
17+
name: 3PP License Check using dash-licenses
18+
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ubuntu-latest]
23+
node: [18]
24+
java: [11]
25+
26+
runs-on: ${{ matrix.os }}
27+
timeout-minutes: 20
28+
29+
steps:
30+
- name: Checkout
31+
uses: actions/checkout@v3
32+
with:
33+
fetch-depth: 2
34+
35+
- name: Use Node.js ${{ matrix.node }}
36+
uses: actions/setup-node@v3
37+
with:
38+
node-version: ${{ matrix.node }}
39+
40+
- name: Use Java ${{ matrix.java }}
41+
uses: actions/setup-java@v3
42+
with:
43+
distribution: 'adopt'
44+
java-version: ${{ matrix.java }}
45+
46+
- name: Run dash-licenses
47+
shell: bash
48+
run: |
49+
yarn --frozen-lockfile --ignore-scripts
50+
yarn license:check
51+
env:
52+
DASH_TOKEN: ${{ secrets.DASH_LICENSES_PAT }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ bundle.js
44
coverage
55
lib
66
node_modules
7+
license-check-summary.txt*

configs/license-check-config.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"project": "ecd.cdt-cloud",
3+
"review": false,
4+
"inputFile": "yarn.lock",
5+
"batch": 50,
6+
"timeout": 200,
7+
"summary": "license-check-summary.txt"
8+
}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
"start": "lerna run start",
1010
"test": "lerna run test --",
1111
"publish:latest": "lerna publish --registry=https://registry.npmjs.org/ --exact --no-git-tag-version --no-push",
12-
"publish:next": "lerna publish --registry=https://registry.npmjs.org/ --exact --canary minor --preid=next.$(date -u '+%Y%m%d%H%M%S').$(git rev-parse --short HEAD) --dist-tag=next --no-git-tag-version --no-push --yes"
12+
"publish:next": "lerna publish --registry=https://registry.npmjs.org/ --exact --canary minor --preid=next.$(date -u '+%Y%m%d%H%M%S').$(git rev-parse --short HEAD) --dist-tag=next --no-git-tag-version --no-push --yes",
13+
"license:check": "npx dash-licenses-wrapper --configFile=./configs/license-check-config.json",
14+
"license:check:review": "npx dash-licenses-wrapper --configFile=./configs/license-check-config.json --review"
1315
},
1416
"keywords": [
1517
"gantt",
@@ -26,6 +28,7 @@
2628
},
2729
"homepage": "https://github.com/theia-ide/timeline-chart",
2830
"devDependencies": {
31+
"@eclipse-dash/nodejs-wrapper": "^0.0.1",
2932
"lerna": "^7.0.0",
3033
"typescript": "^5.2.2"
3134
},

yarn.lock

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,11 @@
319319
resolved "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70"
320320
integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw==
321321

322+
"@eclipse-dash/nodejs-wrapper@^0.0.1":
323+
version "0.0.1"
324+
resolved "https://registry.yarnpkg.com/@eclipse-dash/nodejs-wrapper/-/nodejs-wrapper-0.0.1.tgz#f2629671cf090a84c4d69a8fec42f198e583d103"
325+
integrity sha512-Rkk8O8hEVi/+LC/co7ly1zGLVwCNJG3yPbalsz1FHAqk6WZyEaWNf29EX6jz4vTfR5wpv2xAfF2yokKuStiOdA==
326+
322327
"@hutson/parse-repository-url@^3.0.0":
323328
version "3.0.2"
324329
resolved "https://registry.npmjs.org/@hutson/parse-repository-url/-/parse-repository-url-3.0.2.tgz#98c23c950a3d9b6c8f0daed06da6c3af06981340"

0 commit comments

Comments
 (0)