Skip to content

Commit

Permalink
feat: add license check workflow and dependency
Browse files Browse the repository at this point in the history
- added `license-checker` managing licenses
- created a GitHub Actions workflow to generate and update LICENSES.md with dependency licenses
  • Loading branch information
donni106 committed Feb 12, 2025
1 parent cd9374f commit 9038288
Show file tree
Hide file tree
Showing 3 changed files with 235 additions and 10 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/license-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: License Check

on:
push:
branches:
- master
paths-ignore:
- LICENSES.md
pull_request:
branches:
- master

jobs:
license_check:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install dependencies
run: |
npm install
npm install --save-dev license-checker
- name: Generate license report as json
run: |
node_modules/.bin/license-checker --json > licenses.json
- name: Create LICENSES.md
run: |
echo "# License Report" > LICENSES.md
echo "This file contains the licenses of the dependencies used in this project." >> LICENSES.md
cat licenses.json >> LICENSES.md
- uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update LICENSES.md with latest dependencies information"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
"jest": "~29.7.0",
"jest-expo": "~52.0.3",
"jest-styled-components": "^6.3.4",
"license-checker": "^25.0.1",
"mixin-deep": "^1.3.2",
"prettier": "^2.8.6",
"react-test-renderer": "^18.2.0",
Expand Down
Loading

0 comments on commit 9038288

Please sign in to comment.