-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (44 loc) · 1.38 KB
/
licenses.yml
File metadata and controls
54 lines (44 loc) · 1.38 KB
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
52
53
54
name: Update Third-Party Licenses
on:
push:
branches: [main]
paths:
- 'package-lock.json'
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
update-licenses:
name: Update Licenses
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Generate third-party license file
run: npx generate-license-file --input package.json --output THIRD_PARTY_LICENSES.txt --overwrite
- name: Check for changes
id: check
run: |
if git diff --quiet THIRD_PARTY_LICENSES.txt; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: steps.check.outputs.changed == 'true'
uses: peter-evans/create-pull-request@v7
with:
commit-message: 'chore: update third-party licenses'
title: 'chore: update third-party licenses'
body: |
This PR updates the THIRD_PARTY_LICENSES.txt file with the latest
license information from npm dependencies.
Auto-generated by the licenses workflow.
branch: chore/update-licenses
delete-branch: true
labels: dependencies