Update README.md

This commit is contained in:
Federico Builes
2022-06-14 12:24:27 +02:00
committed by GitHub
parent fd6e756c7b
commit 2860b57e48
+83
View File
@@ -30,6 +30,89 @@ jobs:
Please keep in mind that you need a GitHub Advanced Security license if you're running this Action on private repos.
## Configuration
You can pass additional configuration options to Dependency Review
Action using your workflow file. Here's an example workflow file with
all the possible configuration options:
```yaml
name: 'Dependency Review'
on: [pull_request]
permissions:
contents: read
jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3
- name: Dependency Review
uses: actions/dependency-review-action@v2
with:
# Possible values: "critical", "high", "moderate", "low"
# fail-on-severity: critical
#
# You can only can only include one of these two options: `allow-licenses` and `deny-licences`
#
# Possible values: Any `spdx_id` value(s) from https://docs.github.com/en/rest/licenses
# allow-licenses: GPL-3.0, BSD-3-Clause, MIT
#
# Possible values: Any `spdx_id` value(s) from https://docs.github.com/en/rest/licenses
# deny-licenses: LGPL-2.0, BSD-2-Clause
```
### Vulnerability Severity
By default the Action blocks any pull request that contains a
vulnerable dependency, regardless of the severity level. You can override this behavior by
using the `fail-on-severity` option. The possible values are: "critical", "high", "moderate", "low". The
Action defaults to `low`.
This example will only block pull requests with `critical` and `high` vulnerabilities:
```yaml
- name: Dependency Review
uses: actions/dependency-review-action@v2
with:
fail-on-severity: high
```
### Licenses
You can block pull requests based on the licenses of the dependencies
they introduce. With `allow-licenses` you can define the list of licenses
your repo will accept. Alternatively, you can use `deny-licenses` to only
forbid a subset of licenses.
You can use the [Licenses
API](https://docs.github.com/en/rest/licenses) to see the full list of
supported licenses. Use the `spdx_id` field for every license you want
to filter. A couple of examples:
```yaml
# only allow MIT-licensed dependents
- name: Dependency Review
uses: actions/dependency-review-action@v2
with:
allow-licenses: MIT
```
```yaml
# Block Apache 1.1 and 2.0 licensed dependents
- name: Dependency Review
uses: actions/dependency-review-action@v2
with:
deny-licenses: Apache-1.1, Apache-2.0
```
**Important**
* The Action will only accept one of the two parameters, an error will
be raised if you provide both.
* By default both parameters are empty (no license checking is
performed).
## Getting help
If you have bug reports, questions or suggestions please [create a new