Skip to content

Commit

Permalink
Add github action to check license header and dependencies license (#66)
Browse files Browse the repository at this point in the history
* feat(): add github action for license headers and license checker dev dependency

Signed-off-by: sBouzols <[email protected]>
  • Loading branch information
sBouzols authored Mar 28, 2024
1 parent 631d8ea commit ef87ecd
Show file tree
Hide file tree
Showing 16 changed files with 443 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
17 changes: 17 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,22 @@ name: CI
on: [push]

jobs:
license-headers:
name: Check licenses headers
runs-on: ubuntu-latest

steps:
- uses: actions/setup-node@v3
- name: Checkout sources
uses: actions/checkout@v2
with:
persist-credentials: false

- name: Check License Header (Check Mode)
uses: apache/skywalking-eyes/[email protected]
with:
config: .github/config/.licenserc.yaml

build-and-deploy:
runs-on: ubuntu-latest

Expand All @@ -19,6 +35,7 @@ jobs:
- name: Install and Build
run: |
npm install
npm run licenses-check
npm run-script test
npm run-script build
Expand Down
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": []
}
Loading

0 comments on commit ef87ecd

Please sign in to comment.