You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add license-policy, fail-on, and sarif-file inputs for CI gating (#1)
* feat: add license-policy, fail-on, and sarif-file inputs for CI gating
Surface the Provenant compliance gate as first-class inputs: `license-policy`
(YAML policy file), `fail-on` (error|warning; fails the job when a matching
license is found), and `sarif-file` (SARIF 2.1.0 for code-scanning upload). The
entrypoint maps each to the corresponding `provenant scan` flag when set. Adds a
README example that gates the build and uploads findings via upload-sarif.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
* docs: clarify the action auto-tracks latest Provenant (no per-release commits)
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
---------
Signed-off-by: Maxim Stykow <maxim.stykow@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: README.md
+45-13Lines changed: 45 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -69,12 +69,39 @@ jobs:
69
69
args: --license --package --copyright
70
70
```
71
71
72
+
### Fail the build on a disallowed license
73
+
74
+
Provide a [license-policy file](https://github.com/getprovenant/provenant/blob/main/docs/CLI_GUIDE.md#the-license-policy-file)
75
+
that marks licenses with a `compliance_alert`, then gate on it. The job fails
76
+
when a matching license is found, and the SARIF file surfaces the violations as
77
+
pull-request and code-scanning alerts:
78
+
79
+
```yaml
80
+
permissions:
81
+
contents: read
82
+
security-events: write # to upload SARIF
83
+
84
+
jobs:
85
+
license-gate:
86
+
runs-on: ubuntu-latest
87
+
steps:
88
+
- uses: actions/checkout@v7
89
+
- uses: getprovenant/provenant-action@v1
90
+
with:
91
+
license-policy: .github/license-policy.yml
92
+
fail-on: error
93
+
sarif-file: provenant.sarif
94
+
- uses: github/codeql-action/upload-sarif@v3
95
+
if: always() # upload findings even when the gate fails the job
96
+
with:
97
+
sarif_file: provenant.sarif
98
+
```
99
+
72
100
### Other scan options
73
101
74
102
Any `provenant scan` flag can be passed through `args` — for example
75
-
`--ignore "node_modules/*"`to skip noise, `--incremental` with a cached
76
-
`--cache-dir`to reuse work across runs, or `--license-policy policy.yml` for
77
-
policy-aware review. See the [CLI Guide](https://github.com/getprovenant/provenant/blob/main/docs/CLI_GUIDE.md)
103
+
`--ignore "node_modules/*"`to skip noise or `--incremental` with a cached
104
+
`--cache-dir`to reuse work across runs. See the [CLI Guide](https://github.com/getprovenant/provenant/blob/main/docs/CLI_GUIDE.md)
78
105
for the full set of workflows and flags.
79
106
80
107
## Inputs
@@ -86,11 +113,15 @@ for the full set of workflows and flags.
86
113
| `output-file` | `-` | Where to write the report. `-` streams to stdout (the workflow log); any other value is a path written inside the workspace. |
87
114
| `args` | `--license --package` | Extra raw arguments appended verbatim to `provenant scan`. Detections are opt-in — this is where you enable them (`--license`, `--package`, `--copyright`, `--info`, `--email`, `--url`, …). |
88
115
| `paths-file` | _(empty)_ | Optional file listing exact files/directories to scan (one per line), relative to a single scan root in `paths`. Ideal for pull-request CI via `git diff --name-only`. When set, `paths` must stay a single root (the default `.`). |
116
+
| `license-policy` | _(empty)_ | Optional path to a YAML license-policy file. Enables policy evaluation; required by `fail-on` and by SARIF output. |
117
+
| `fail-on` | _(empty)_ | Fail the job (exit 3) when a file matches a policy whose `compliance_alert` is at or above this level: `error`or `warning`. Requires `license-policy`. |
118
+
| `sarif-file` | _(empty)_ | Also write SARIF 2.1.0 of policy violations to this path, for `github/codeql-action/upload-sarif`. Meaningful only with `license-policy`. |
0 commit comments