Skip to content

Commit

Permalink
chore: add a license checker (#179)
Browse files Browse the repository at this point in the history
* chore: add a license checker

generate the required csv
write to output file and install global license check
print if fails
exclude permissive licenses in report
  • Loading branch information
robertsevernsentient committed Mar 1, 2024
1 parent dff5f07 commit 60d9c80
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Check licenses

on:
pull_request:
branches:
- master

jobs:
license_check:
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v1
with:
node-version: '16.14.2'
- name: Checkout Ref
uses: actions/checkout@v1
- name: Install dependencies
run: npm install && npm install -g license-checker
- name: Generate license-checker CSV file
run: license-checker --start --production --csv --out npm-license-checker.csv
- name: Check license-checker CSV file without headers
id: license_check_report
uses: pilosus/action-pip-license-checker@v2
with:
external: 'npm-license-checker.csv'
external-format: 'csv'
external-options: '{:skip-header true}'
fail: 'StrongCopyleft,NetworkCopyleft,Other,Error'
fails-only: true
exclude: 'evolv-ai*,SentientTechnologies*'
exclude-license: '(?i)copyright'
totals: true
verbose: 1
github-token: ${{ secrets.GH_TOKEN }}
- name: Print incorrect dependencies (failure)
if: failure()
run: license-checker --start --production --exclude 'BSD, MIT, Apache-2.0'


15 changes: 14 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@
"outdent": "^0.8.0",
"rollup": "^2.78.1",
"rollup-plugin-copy": "^3.4.0",
"sinon": "^15.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.7.4",
"xhr-mock": "^2.5.1",
"xmlhttprequest": "^1.8.0",
"sinon": "^15.0.3"
"xmlhttprequest": "^1.8.0"
},
"mocha": {
"extension": [
Expand All @@ -99,5 +99,8 @@
"exclude": [
"**/*.test.js"
]
},
"dependencies": {
"yui-lint": "^0.2.0"
}
}

0 comments on commit 60d9c80

Please sign in to comment.