actions/dependency-review-action@v5
Prevent the introduction of dependencies with known vulnerabilities
At a glance
- Latest major
v5- Repository
- actions/dependency-review-action
- Inputs
- 22 (0 required)
- Outputs
- 5
- Runs using
node24- License
- MIT
- Last checked
Inputs and outputs come straight from the action's official action.yml. See our editorial standards.
Usage
- uses: actions/dependency-review-action@v5Inputs
| Name | Required | Default | Description |
|---|---|---|---|
repo-token | No | ${{ github.token }} | Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`. |
fail-on-severity | No | none | Don't block PRs below this severity. Possible values are `low`, `moderate`, `high`, `critical`. |
fail-on-scopes | No | none | Dependency scopes to block PRs on. Comma-separated list. Possible values are 'unknown', 'runtime', and 'development' (e.g. "runtime, development") |
base-ref | No | none | The base git ref to be used for this check. Has a default value when the workflow event is `pull_request` or `pull_request_target`. Must be provided otherwise. |
head-ref | No | none | The head git ref to be used for this check. Has a default value when the workflow event is `pull_request` or `pull_request_target`. Must be provided otherwise. |
config-file | No | none | A path to the configuration file for the action. |
allow-licenses | No | none | Comma-separated list of allowed licenses (e.g. "MIT, GPL 3.0, BSD 2 Clause") |
deny-licenses | No | none | Comma-separated list of forbidden licenses (e.g. "MIT, GPL 3.0, BSD 2 Clause") |
allow-dependencies-licenses | No | none | Comma-separated list of dependencies in purl format (e.g. "pkg:npm/express, pkg:pypi/pycrypto"). These dependencies will be permitted to use any license, no matter what license policy is enforced otherwise. |
allow-ghsas | No | none | Comma-separated list of allowed GitHub Advisory IDs (e.g. "GHSA-abcd-1234-5679, GHSA-efgh-1234-5679") |
external-repo-token | No | none | A token for fetching external configuration file if it lives in another repository. It is required if the repository is private |
license-check | No | none | A boolean to determine if license checks should be performed |
vulnerability-check | No | none | A boolean to determine if vulnerability checks should be performed |
comment-summary-in-pr | No | none | Determines if the summary is posted as a comment in the PR itself. Setting this to `always` or `on-failure` requires you to give the workflow `pull-requests: write` permissions |
deny-packages | No | none | A comma-separated list of package URLs to deny (e.g. "pkg:npm/express, pkg:pypi/pycrypto"). If version specified, only deny matching packages and version; else, deny all regardless of version. |
deny-groups | No | none | A comma-separated list of package URLs for group(s)/namespace(s) to deny (e.g. "pkg:npm/express/, pkg:pypi/pycrypto/"). Please note that the group name must be followed by a `/`. |
retry-on-snapshot-warnings | No | none | Whether to retry on snapshot warnings |
retry-on-snapshot-warnings-timeout | No | none | Number of seconds to wait before stopping snapshot retries. |
warn-only | No | none | When set to `true` this action will always complete with success, overriding the `fail-on-severity` parameter. |
show-openssf-scorecard | No | none | Show a summary of the OpenSSF Scorecard scores. |
warn-on-openssf-scorecard-level | No | none | Numeric threshold for the OpenSSF Scorecard score. If the score is below this threshold, the action will warn you. |
show-patched-versions | No | none | When set to `true`, the vulnerability summary table will include a column showing the first patched version for each vulnerability. |
Outputs
| Name | Description |
|---|---|
comment-content | Prepared dependency report comment |
dependency-changes | All dependency changes (JSON) |
vulnerable-changes | Vulnerable dependency changes (JSON) |
invalid-license-changes | Invalid license dependency changes (JSON) |
denied-changes | Denied dependency changes (JSON) |
Read an output with ${{ steps.<step-id>.outputs.<name> }}; the step needs an id.
Examples
Block risky dependency changes
Fail a pull request that adds a vulnerable dependency of high severity or worse.
name: Example
on:
pull_request:
permissions:
contents: read
jobs:
example:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Dependency Review
uses: actions/dependency-review-action@v5
with:
fail-on-severity: highEach example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.
Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.