Skip to content

Commit 64a2509

Browse files
Merge pull request github#28355 from github/mchammer01/dependency-review-action-config
[Ready to ship] - Configuring the dependency review action - [Public Beta]
2 parents 4f2a364 + 221c806 commit 64a2509

File tree

7 files changed

+80
-4
lines changed

7 files changed

+80
-4
lines changed

content/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,19 @@ The dependency review feature becomes available when you enable the dependency g
5050

5151
{% data reusables.dependency-review.dependency-review-action-beta-note %}
5252

53-
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).
53+
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.
54+
55+
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).
5456

5557
![Dependency review action example](/assets/images/help/graphs/dependency-review-action.png)
5658

57-
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)."
59+
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)."
5860

5961
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)."
62+
63+
{% ifversion dependency-review-action-configuration %}
64+
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)."
6065
{% endif %}
66+
67+
{% endif %}
68+

content/code-security/supply-chain-security/understanding-your-software-supply-chain/configuring-dependency-review.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,56 @@ Dependency review is available when dependency graph is enabled for {% data vari
5050
![Screenshot of "Code security and analysis" features"](/assets/images/enterprise/3.2/repository/code-security-and-analysis-enable-ghas-3.2.png){% endif %}{% ifversion ghes > 3.2 %}
5151
![Screenshot of "Code security and analysis" features"](/assets/images/enterprise/3.4/repository/code-security-and-analysis-enable-ghas-3.4.png){% endif %}
5252
{% endif %}
53+
54+
{% ifversion dependency-review-action-configuration %}
55+
## Configuring the {% data variables.product.prodname_dependency_review_action %}
56+
57+
{% data reusables.dependency-review.dependency-review-action-beta-note %}
58+
{% data reusables.dependency-review.dependency-review-action-overview %}
59+
60+
The following configuration options are available.
61+
62+
| Option | Required | Usage |
63+
|------------------|-------------------------------|--------|
64+
| `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. |
65+
| `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.|
66+
| `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.|
67+
68+
{% tip %}
69+
70+
**Tip:** The `allow-licenses` and `deny-licenses` options are mutually exclusive.
71+
72+
{% endtip %}
73+
74+
This {% data variables.product.prodname_dependency_review_action %} example file illustrates how you can use these configuration options.
75+
76+
```yaml{:copy}
77+
name: 'Dependency Review'
78+
on: [pull_request]
79+
80+
permissions:
81+
contents: read
82+
83+
jobs:
84+
dependency-review:
85+
runs-on: ubuntu-latest
86+
steps:
87+
- name: 'Checkout Repository'
88+
uses: {% data reusables.actions.action-checkout %}
89+
- name: Dependency Review
90+
uses: actions/dependency-review-action@v2
91+
with:
92+
# Possible values: "critical", "high", "moderate", "low"
93+
fail-on-severity: critical
94+
# You can only can only include one of these two options: `allow-licenses` and `deny-licences`
95+
# ([String]). Only allow these licenses (optional)
96+
# Possible values: Any `spdx_id` value(s) from https://docs.github.com/en/rest/licenses
97+
# allow-licenses: GPL-3.0, BSD-3-Clause, MIT
98+
99+
# ([String]). Block the pull request on these licenses (optional)
100+
# Possible values: Any `spdx_id` value(s) from https://docs.github.com/en/rest/licenses
101+
# deny-licenses: LGPL-2.0, BSD-2-Clause
102+
```
103+
104+
For further details about the configuration options, see [`dependency-review-action`](https://github.com/actions/dependency-review-action#readme).
105+
{% endif %}

content/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/reviewing-dependency-changes-in-a-pull-request.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,14 @@ shortTitle: Review dependency changes
3535
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)."
3636

3737
{% ifversion fpt or ghec or ghes > 3.5 or ghae-issue-6396 %}
38-
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)."
38+
39+
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 %}
40+
41+
{% ifversion dependency-review-action-configuration %}
42+
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)."
3943
{% endif %}
4044

45+
{% endif %}
4146
## Reviewing dependencies in a pull request
4247

4348
{% data reusables.repositories.sidebar-pr %}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Reference: Issue #7061 Configuring the dependency review action - [Public Beta]
2+
versions:
3+
fpt: '*'
4+
ghec: '*'
5+
ghes: '>3.5'
6+
ghae: 'issue-7061'
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{% note %}
22

3-
**Note**: The Dependency Review GitHub Action is currently in public beta and subject to change.
3+
**Note**: The {% data variables.product.prodname_dependency_review_action %} is currently in public beta and subject to change.
44

55
{% endnote %}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
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.
2+
3+
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.

data/variables/product.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ prodname_code_scanning_capc: 'Code scanning'
181181
prodname_codeql_runner: 'CodeQL runner'
182182
prodname_advisory_database: 'GitHub Advisory Database'
183183
prodname_codeql_workflow: 'CodeQL analysis workflow'
184+
prodname_dependency_review_action: 'Dependency Review GitHub Action'
184185

185186
# Visual Studio
186187
prodname_vs: 'Visual Studio'

0 commit comments

Comments
 (0)