Dependency Review
ActionsTags
(2)Verified
- dependency-review-action
The dependency review action scans your pull requests for dependency changes, and will raise an error if any vulnerabilities or invalid licenses are being introduced. The action is supported by an API endpoint that diffs the dependencies between any two revisions on your default branch.
The action is available for:
- Public repositories
- Private repositories with a GitHub Advanced Security license.
When the action runs, you can see the results on:
-
The job logs page.
- Go to the Actions tab for the repository and select the relevant workflow run.
- Then under "Jobs", click dependency review.
-
The job summary page.
You can install the action on any public repository, or any organization-owned private repository, provided the organization has a GitHub Advanced Security license.
Note: Dependency Review Action v5.0.0 updates the runtime to node24. This requires a minimum Actions Runner version v2.327.1 to run.
-
Add a new YAML workflow to your
.github/workflowsfolder:name: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' uses: actions/checkout@v6 - name: 'Dependency Review' uses: actions/dependency-review-action@v5
You can install the action on repositories on GitHub Enterprise Server.
-
Ensure GitHub Advanced Security and GitHub Connect are enabled for the enterprise.
-
Ensure you have installed the dependency-review-action on the server.
-
Add a new YAML workflow to your
.github/workflowsfolder:name: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: self-hosted steps: - name: 'Checkout Repository' uses: actions/checkout@v6 - name: 'Dependency Review' uses: actions/dependency-review-action@v5
-
In the workflow file, replace the
runs-onvalue with the label of any of your runners. (The default value isself-hosted.)
There are various configuration options you can use to specify settings for the dependency review action.
All configuration options are optional.
Note
- * Not supported for use with GitHub Enterprise Server. (Checking for licenses is not supported on GitHub Enterprise Server because the API does not return license information.)
- + When
warn-onlyis set totrue, all vulnerabilities, independently of the severity, will be reported as warnings and the action will not fail. - The
allow-licensesanddeny-licensesoptions are mutually exclusive; an error will be raised if you provide both. - If we can't detect the license for a dependency we will inform you, but the action won't fail.
To specify settings for the dependency review action, you can choose from two options:
- Option 1: Inline the configuration options in your workflow file.
- Option 2: Reference an external configuration file in your workflow file.
You can pass configuration options to the dependency review action using your workflow file.
-
In the same YAML workflow file you created during installation, use the
with:key to specify your chosen settings:name: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' uses: actions/checkout@v6 - name: Dependency Review uses: actions/dependency-review-action@v5 with: fail-on-severity: moderate # Use comma-separated names to pass list arguments: deny-licenses: LGPL-2.0, BSD-2-Clause allow-dependencies-licenses: "pkg:npm/@myorg/mypackage, pkg:npm/packagename, pkg:githubactions/owner/repo@2.0.0"
You can use an external configuration file to specify settings for this action. The file can be a local file or a file in an external repository.
-
In the same YAML workflow file you created during installation, use
config-fileto specify that you are using an external configuration file.name: 'Dependency Review' on: [pull_request] permissions: contents: read jobs: dependency-review: runs-on: ubuntu-latest steps: - name: 'Checkout Repository' uses: actions/checkout@v6 - name: Dependency Review uses: actions/dependency-review-action@v5 with: config-file: './.github/dependency-review-config.yml'
Option Usage Possible values config-fileA path to a file in the current repository or an external repository. Use this syntax for external files: OWNER/REPOSITORY/FILENAME@BRANCHLocal file: ./.github/dependency-review-config.yml
External repo:github/octorepo/dependency-review-config.yml@main -
Optionally, if the file resides in a private external repository, and for all GitHub Enterprise Server repositories, use
external-repo-tokento specify a token for fetching the file.- name: Dependency Review uses: actions/dependency-review-action@v5 with: config-file: 'github/octorepo/dependency-review-config.yml@main' external-repo-token: 'ghp_123456789abcde'
-
Create the configuration file in the path you specified for
config-file. -
In the configuration file, specify your chosen settings.
fail-on-severity: 'critical' allow-licenses: - 'GPL-3.0' - 'BSD-3-Clause' - 'MIT'
License data comes from ClearlyDefined and you may sometimes see licenses displayed with the string OTHER in them. ClearlyDefined defines OTHER as:
This indicates that a human confirmed that there is license information in the file but that the license is not an SPDX-identified license.
OTHER is not a valid SPDX license identifier, so we convert OTHER in a license string into LicenseRef-clearlydefined-OTHER, which is valid in SPDX. If you want to add that to the deny or allow list, be sure to add LicenseRef-clearlydefined-OTHER to this list, because that is what we'll actually be comparing.
- For more examples of how to use this action and its configuration options, see the examples page.
- For general information about dependency review on GitHub, see "About dependency review" in the GitHub Docs documentation.
You can configure your repository to block a pull request from being merged if the pull request fails the dependency review action check. To do this, the repository owner must configure branch protection settings that require the check to pass before merging. For more information, see "Require status checks before merging" in GitHub Docs documentation.
Dependency review action can create outputs, so that data from its execution can be used by other jobs in a workflow.
comment-contentis generated with the same content as would be present in a Dependency Review Action comment.dependency-changesholds all dependency changes in a JSON format. The following outputs are subsets ofdependency-changesfiltered based on the configuration:vulnerable-changesholds information about dependency changes with vulnerable dependencies in a JSON format.invalid-license-changesholds information about invalid or non-compliant license dependency changes in a JSON format.denied-changesholds information about denied dependency changes in a JSON format.
Note
Action outputs are unicode strings with a 1MB size limit.
If you use these outputs in a run-step, you must store the output data in an environment variable instead of using the output directly. Using an output directly might break shell scripts. For example:
env:
VULNERABLE_CHANGES: ${{ steps.review.outputs.vulnerable-changes }}
run: |
echo "$VULNERABLE_CHANGES" | jqinstead of direct echo '${{ steps.review.outputs.vulnerable-changes }}'.
See examples for more.
If you have bug reports, questions or suggestions please create a new issue.
We are grateful for any contributions made to this project. Please read CONTRIBUTING.MD to get started.
This project is released under the MIT License.

