-
Notifications
You must be signed in to change notification settings - Fork 11
51 lines (42 loc) · 1.44 KB
/
update-licences.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
name: Update licenses
# Controls when the workflow will run
on:
schedule:
- cron: '0 8 15 * *'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
get-licenses:
runs-on: ubuntu-latest
steps:
- name: Check-out mainsail-docs repo
uses: actions/checkout@v3
with:
path: ./docs
- name: Check-out Mainsail repo
uses: actions/checkout@v3
with:
path: ./mainsail
repository: mainsail-crew/mainsail
- name: Install Node
uses: actions/setup-node@v3
with:
node-version: '18'
- name: Install dependencies
run: |
cd mainsail
npm ci
npm i npm-license-crawler -g
- name: Generate license information and commit
run: |
npm-license-crawler --production --onlyDirectDependencies --omitVersion --dependencies --json ${GITHUB_WORKSPACE}/docs/_data/licenses.json
sed -e 's/\*//g' -i ${GITHUB_WORKSPACE}/docs/_data/licenses.json
sed -e 's/[email protected]/https:\/\/github.com/' -i ${GITHUB_WORKSPACE}/docs/_data/licenses.json
cd ${GITHUB_WORKSPACE}/docs
git config user.name github-actions
git config user.email [email protected]
if [[ -n $(git status -s) ]]; then
git add .
git commit -m "updated license information"
git push
fi