-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yaml
More file actions
64 lines (62 loc) · 2.73 KB
/
Copy pathaction.yaml
File metadata and controls
64 lines (62 loc) · 2.73 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
55
56
57
58
59
60
61
62
63
64
name: Check Licenses
description: >-
Check that all dependencies use allowed licenses, based on the Google
licenseclassifier categories (reciprocal, notice, unencumbered). Requires
Node.js, pnpm, and dependencies to be installed by the caller.
inputs:
license-groups:
description: >-
Which Google licenseclassifier categories to allow, out of reciprocal,
notice, unencumbered. Comma- or newline-separated. Defaults to all
three. Including "reciprocal" (weak-copyleft licenses like
MPL/EPL/CDDL) is a licensing-policy decision, not a fixed fact — source
this from a `LICENSE_GROUPS` GitHub Variable so it can be changed
without editing workflows.
required: false
default: ""
additional-licenses:
description: >-
Extra individually-allowed SPDX license identifiers, beyond the
selected license-groups. Comma- or newline-separated (e.g. from an
`ALLOWED_LICENSES` GitHub Variable).
required: false
default: ""
denied-licenses:
description: >-
SPDX license identifiers to remove from the allow set, even if they
belong to a selected group. Comma- or newline-separated.
required: false
default: ""
package-exceptions:
description: >-
Approve specific dependency routes to an otherwise-disallowed license,
independent of license-groups/additional-licenses/denied-licenses. A
JSON object mapping a license string to an array of dependency chains,
e.g. `{"LGPL-3.0-or-later": [["nextjs-app", "next"]]}`. Each chain is
an ordered list of package names (workspace project name first;
"*" globs allowed) that must appear, in order, along the path from a
workspace project down to the violating package — found via
`pnpm why <package> -r --json` — though the chain need not end at the
violating package itself; other dependencies may appear between
listed names. Prefer this over additional-licenses when approving a
specific route to a license, not the license in general — approving
one package's LGPL-licensed binary shouldn't silently bless every
future LGPL dependency. Requires pnpm.
required: false
default: ""
working-directory:
description: Working directory for the project (for monorepo setups)
required: false
default: "."
runs:
using: composite
steps:
- name: Check licenses
shell: bash
working-directory: ${{ inputs.working-directory }}
env:
LICENSE_GROUPS: ${{ inputs.license-groups }}
ADDITIONAL_LICENSES: ${{ inputs.additional-licenses }}
DENIED_LICENSES: ${{ inputs.denied-licenses }}
PACKAGE_EXCEPTIONS: ${{ inputs.package-exceptions }}
run: node "${{ github.action_path }}/check-licenses.mjs"