Merge pull request #28355 from github/mchammer01/dependency-review-action-config
[Ready to ship] - Configuring the dependency review action - [Public Beta]
This commit is contained in:
@@ -50,11 +50,19 @@ The dependency review feature becomes available when you enable the dependency g
|
||||
|
||||
{% data reusables.dependency-review.dependency-review-action-beta-note %}
|
||||
|
||||
You can use the Dependency Review GitHub Action in your repository to enforce dependency reviews on your pull requests. The action scans for vulnerable versions of dependencies introduced by package version changes in pull requests, and warns you about the associated security vulnerabilities. This gives you better visibility of what's changing in a pull request, and helps prevent vulnerabilities being added to your repository. For more information, see [`dependency-review-action`](https://github.com/actions/dependency-review-action).
|
||||
The action is available for all {% ifversion fpt or ghec %}public repositories, as well as private {% endif %}repositories that have {% data variables.product.prodname_GH_advanced_security %} enabled.
|
||||
|
||||
You can use the {% data variables.product.prodname_dependency_review_action %} in your repository to enforce dependency reviews on your pull requests. The action scans for vulnerable versions of dependencies introduced by package version changes in pull requests, and warns you about the associated security vulnerabilities. This gives you better visibility of what's changing in a pull request, and helps prevent vulnerabilities being added to your repository. For more information, see [`dependency-review-action`](https://github.com/actions/dependency-review-action).
|
||||
|
||||

|
||||
|
||||
The Dependency Review GitHub Action check will fail if it discovers any vulnerable package, but will only block a pull request from being merged if the repository owner has required the check to pass before merging. For more information, see "[About protected branches](/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches#require-status-checks-before-merging)."
|
||||
By default, the {% data variables.product.prodname_dependency_review_action %} check will fail if it discovers any vulnerable packages. A failed check blocks a pull request from being merged when the repository owner requires the dependency review check to pass. For more information, see "[About protected branches](/repositories/configuring-branches-and-merges-in-your-repository/defining-the-mergeability-of-pull-requests/about-protected-branches#require-status-checks-before-merging)."
|
||||
|
||||
The action uses the Dependency Review REST API to get the diff of dependency changes between the base commit and head commit. You can use the Dependency Review API to get the diff of dependency changes, including vulnerability data, between any two commits on a repository. For more information, see "[Dependency review](/rest/reference/dependency-graph#dependency-review)."
|
||||
|
||||
{% ifversion dependency-review-action-configuration %}
|
||||
You can configure the {% data variables.product.prodname_dependency_review_action %} to better suit your needs. For example, you can specify the severity level that will make the action fail, or set an allow or deny list for licenses to scan. For more information, see "[Configuring dependency review](/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review#configuring-the-dependency-review-github-action)."
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
@@ -50,3 +50,56 @@ Dependency review is available when dependency graph is enabled for {% data vari
|
||||
{% endif %}{% ifversion ghes > 3.2 %}
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
|
||||
{% ifversion dependency-review-action-configuration %}
|
||||
## Configuring the {% data variables.product.prodname_dependency_review_action %}
|
||||
|
||||
{% data reusables.dependency-review.dependency-review-action-beta-note %}
|
||||
{% data reusables.dependency-review.dependency-review-action-overview %}
|
||||
|
||||
The following configuration options are available.
|
||||
|
||||
| Option | Required | Usage |
|
||||
|------------------|-------------------------------|--------|
|
||||
| `fail-on-severity` | Optional | Defines the threshold for level of severity (`low`, `moderate`, `high`, `critical`).</br>The action will fail on any pull requests that introduce vulnerabilities of the specified severity level or higher. |
|
||||
| `allow-licenses` | Optional | Contains a list of allowed licenses. You can find the possible values for this parameter in the [Licenses](/rest/licenses) page of the API documentation.</br>The action will fail on pull requests that introduce dependencies with licenses that do not match the list.|
|
||||
| `deny-licenses` | Optional | Contains a list of prohibited licenses. You can find the possible values for this parameter in the [Licenses](/rest/licenses) page of the API documentation.</br>The action will fail on pull requests that introduce dependencies with licenses that match the list.|
|
||||
|
||||
{% tip %}
|
||||
|
||||
**Tip:** The `allow-licenses` and `deny-licenses` options are mutually exclusive.
|
||||
|
||||
{% endtip %}
|
||||
|
||||
This {% data variables.product.prodname_dependency_review_action %} example file illustrates how you can use these configuration options.
|
||||
|
||||
```yaml{:copy}
|
||||
name: 'Dependency Review'
|
||||
on: [pull_request]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
dependency-review:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: 'Checkout Repository'
|
||||
uses: {% data reusables.actions.action-checkout %}
|
||||
- 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`
|
||||
# ([String]). Only allow these licenses (optional)
|
||||
# Possible values: Any `spdx_id` value(s) from https://docs.github.com/en/rest/licenses
|
||||
# allow-licenses: GPL-3.0, BSD-3-Clause, MIT
|
||||
|
||||
# ([String]). Block the pull request on these licenses (optional)
|
||||
# Possible values: Any `spdx_id` value(s) from https://docs.github.com/en/rest/licenses
|
||||
# deny-licenses: LGPL-2.0, BSD-2-Clause
|
||||
```
|
||||
|
||||
For further details about the configuration options, see [`dependency-review-action`](https://github.com/actions/dependency-review-action#readme).
|
||||
{% endif %}
|
||||
|
||||
@@ -35,9 +35,14 @@ shortTitle: Review dependency changes
|
||||
Dependency review allows you to "shift left". You can use the provided predictive information to catch vulnerable dependencies before they hit production. For more information, see "[About dependency review](/code-security/supply-chain-security/about-dependency-review)."
|
||||
|
||||
{% ifversion fpt or ghec or ghes > 3.5 or ghae-issue-6396 %}
|
||||
You can use the Dependency Review GitHub Action to help enforce dependency reviews on pull requests in your repository. For more information, see "[Dependency review enforcement](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement)."
|
||||
|
||||
You can use the {% data variables.product.prodname_dependency_review_action %} to help enforce dependency reviews on pull requests in your repository. {% data reusables.dependency-review.dependency-review-action-overview %}
|
||||
|
||||
{% ifversion dependency-review-action-configuration %}
|
||||
You can configure the {% data variables.product.prodname_dependency_review_action %} to better suit your needs by specifying the type of dependency vulnerability you wish to catch. For more information, see "[Configuring dependency review](/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review#configuring-the-dependency-review-github-action)."
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
## Reviewing dependencies in a pull request
|
||||
|
||||
{% data reusables.repositories.sidebar-pr %}
|
||||
|
||||
6
data/features/dependency-review-action-configuration.yml
Normal file
6
data/features/dependency-review-action-configuration.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
# Reference: Issue #7061 Configuring the dependency review action - [Public Beta]
|
||||
versions:
|
||||
fpt: '*'
|
||||
ghec: '*'
|
||||
ghes: '>3.5'
|
||||
ghae: 'issue-7061'
|
||||
@@ -1,5 +1,5 @@
|
||||
{% note %}
|
||||
|
||||
**Note**: The Dependency Review GitHub Action is currently in public beta and subject to change.
|
||||
**Note**: The {% data variables.product.prodname_dependency_review_action %} is currently in public beta and subject to change.
|
||||
|
||||
{% endnote %}
|
||||
@@ -0,0 +1,3 @@
|
||||
The {% data variables.product.prodname_dependency_review_action %} scans your pull requests for dependency changes and raises an error if any new dependencies have known vulnerabilities. The action is supported by an API endpoint that compares the dependencies between two revisions and reports any differences.
|
||||
|
||||
For more information about the action and the API endpoint, see "[About dependency review](/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-reinforcement)," and "[Dependency review](/rest/dependency-graph/dependency-review)" in the API documentation, respectively.
|
||||
@@ -181,6 +181,7 @@ prodname_code_scanning_capc: 'Code scanning'
|
||||
prodname_codeql_runner: 'CodeQL runner'
|
||||
prodname_advisory_database: 'GitHub Advisory Database'
|
||||
prodname_codeql_workflow: 'CodeQL analysis workflow'
|
||||
prodname_dependency_review_action: 'Dependency Review GitHub Action'
|
||||
|
||||
# Visual Studio
|
||||
prodname_vs: 'Visual Studio'
|
||||
|
||||
Reference in New Issue
Block a user