Skip to content

Commit

Permalink
feat(): Add github action to check header license and license depende…
Browse files Browse the repository at this point in the history
…ncy match with MPL-2.0

Signed-off-by: sBouzols <[email protected]>
  • Loading branch information
sBouzols committed Mar 28, 2024
1 parent c56e4b6 commit 6801eba
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 1 deletion.
26 changes: 26 additions & 0 deletions .github/config/.licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
header:
license:
spdx-id: MPL-2.0
pattern: |
Copyright copyright \d{4}, RTE \(http:\/\/www\.rte-france\.com\)
This Source Code Form is subject to the terms of the Mozilla Public
License, v\. 2\.0\. If a copy of the MPL was not distributed with this
file, You can obtain one at http:\/\/mozilla\.org\/MPL\/2\.0\/\.
paths-ignore:
- 'dist'
- 'licenses'
- '**/*.md'
- 'LICENSE'
- 'NOTICE'
- 'Dockerfile'
- '**/.*'
- '**/*.txt'
- '**/*.json'
- '**/*.yaml'
- '**/*.yml'
- '**/*.svg'
- '**/*.css'
- '**/*.conf'

comment: on-failure
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,15 @@ Create a new view in study-server and replace `yyy` with the new token in rest a

Files tsconfig.json and src/react-app-env.d.ts both results from create-react-app typescript template (version 5).
Some property values have been changed to meet the project needs (ex: target, baseUrl, ...).

#### License Headers and dependencies checking

To check dependencies license compatibility with this project one locally, please run the following command :

```
npm run licenses-check
```

Notes :
* Check [license-checker-config.json](license-checker-config.json) for license white list and exclusion.
If you need to update this list, please inform organization's owners.
21 changes: 21 additions & 0 deletions license-checker-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"onlyAllow" : [
"MPL-2.0",
"MIT",
"BSD-3-Clause",
"BSD-2-Clause",
"0BSD",
"Apache-2.0",
"ISC",
"Apache-Style",
"CC-BY-3.0",
"CC-BY-4.0",
"CC0-1.0",
"MIT AND CC-BY-3.0",
"MIT OR CC0-1.0",
"Artistic-2.0",
"Python-2.0",
"Unlicense"
],
"excludePackages": []
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"test:watch": "react-scripts test",
"test:coverage": "react-scripts test --coverage",
"eject": "react-scripts eject",
"licenses-check": "license-checker --summary --excludePrivatePackages --production --onlyAllow \"MPL-2.0; MIT; BSD-3-Clause; BSD-2-Clause; 0BSD; Apache-2.0; ISC; Apache-Style; CC-BY-3.0; CC-BY-4.0; CC0-1.0; MIT AND CC-BY-3.0; MIT OR CC0-1.0; Artistic-2.0; Python-2.0; Unlicense\""
"licenses-check": "license-checker --summary --excludePrivatePackages --production --onlyAllow \"$( jq -r .onlyAllow[] license-checker-config.json | tr '\n' ';')\" --excludePackages \"$( jq -r .excludePackages[] license-checker-config.json | tr '\n' ';')\""
},
"jest": {
"moduleNameMapper": {
Expand Down

0 comments on commit 6801eba

Please sign in to comment.