Skip to content

Commit ef87ecd

Browse files
authored
Add github action to check license header and dependencies license (#66)
* feat(): add github action for license headers and license checker dev dependency Signed-off-by: sBouzols <[email protected]>
1 parent 631d8ea commit ef87ecd

File tree

16 files changed

+443
-1
lines changed

16 files changed

+443
-1
lines changed

.github/config/.licenserc.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
header:
2+
license:
3+
spdx-id: MPL-2.0
4+
pattern: |
5+
Copyright copyright \d{4}, RTE \(http:\/\/www\.rte-france\.com\)
6+
This Source Code Form is subject to the terms of the Mozilla Public
7+
License, v\. 2\.0\. If a copy of the MPL was not distributed with this
8+
file, You can obtain one at http:\/\/mozilla\.org\/MPL\/2\.0\/\.
9+
10+
paths-ignore:
11+
- 'dist'
12+
- 'licenses'
13+
- '**/*.md'
14+
- 'LICENSE'
15+
- 'NOTICE'
16+
- 'Dockerfile'
17+
- '**/.*'
18+
- '**/*.txt'
19+
- '**/*.json'
20+
- '**/*.yaml'
21+
- '**/*.yml'
22+
- '**/*.svg'
23+
- '**/*.css'
24+
- '**/*.conf'
25+
26+
comment: on-failure

.github/workflows/build.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,22 @@ name: CI
33
on: [push]
44

55
jobs:
6+
license-headers:
7+
name: Check licenses headers
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/setup-node@v3
12+
- name: Checkout sources
13+
uses: actions/checkout@v2
14+
with:
15+
persist-credentials: false
16+
17+
- name: Check License Header (Check Mode)
18+
uses: apache/skywalking-eyes/[email protected]
19+
with:
20+
config: .github/config/.licenserc.yaml
21+
622
build-and-deploy:
723
runs-on: ubuntu-latest
824

@@ -19,6 +35,7 @@ jobs:
1935
- name: Install and Build
2036
run: |
2137
npm install
38+
npm run licenses-check
2239
npm run-script test
2340
npm run-script build
2441

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,15 @@ Create a new view in study-server and replace `yyy` with the new token in rest a
1111

1212
Files tsconfig.json and src/react-app-env.d.ts both results from create-react-app typescript template (version 5).
1313
Some property values have been changed to meet the project needs (ex: target, baseUrl, ...).
14+
15+
#### License Headers and dependencies checking
16+
17+
To check dependencies license compatibility with this project one locally, please run the following command :
18+
19+
```
20+
npm run licenses-check
21+
```
22+
23+
Notes :
24+
* Check [license-checker-config.json](license-checker-config.json) for license white list and exclusion.
25+
If you need to update this list, please inform organization's owners.

license-checker-config.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"onlyAllow" : [
3+
"MPL-2.0",
4+
"MIT",
5+
"BSD-3-Clause",
6+
"BSD-2-Clause",
7+
"0BSD",
8+
"Apache-2.0",
9+
"ISC",
10+
"Apache-Style",
11+
"CC-BY-3.0",
12+
"CC-BY-4.0",
13+
"CC0-1.0",
14+
"MIT AND CC-BY-3.0",
15+
"MIT OR CC0-1.0",
16+
"Artistic-2.0",
17+
"Python-2.0",
18+
"Unlicense"
19+
],
20+
"excludePackages": []
21+
}

0 commit comments

Comments
 (0)