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@v5

Inputs

NameRequiredDefaultDescription
repo-tokenNo${{ github.token }}Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`.
fail-on-severityNononeDon't block PRs below this severity. Possible values are `low`, `moderate`, `high`, `critical`.
fail-on-scopesNononeDependency scopes to block PRs on. Comma-separated list. Possible values are 'unknown', 'runtime', and 'development' (e.g. "runtime, development")
base-refNononeThe 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-refNononeThe 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-fileNononeA path to the configuration file for the action.
allow-licensesNononeComma-separated list of allowed licenses (e.g. "MIT, GPL 3.0, BSD 2 Clause")
deny-licensesNononeComma-separated list of forbidden licenses (e.g. "MIT, GPL 3.0, BSD 2 Clause")
allow-dependencies-licensesNononeComma-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-ghsasNononeComma-separated list of allowed GitHub Advisory IDs (e.g. "GHSA-abcd-1234-5679, GHSA-efgh-1234-5679")
external-repo-tokenNononeA token for fetching external configuration file if it lives in another repository. It is required if the repository is private
license-checkNononeA boolean to determine if license checks should be performed
vulnerability-checkNononeA boolean to determine if vulnerability checks should be performed
comment-summary-in-prNononeDetermines 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-packagesNononeA 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-groupsNononeA 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-warningsNononeWhether to retry on snapshot warnings
retry-on-snapshot-warnings-timeoutNononeNumber of seconds to wait before stopping snapshot retries.
warn-onlyNononeWhen set to `true` this action will always complete with success, overriding the `fail-on-severity` parameter.
show-openssf-scorecardNononeShow a summary of the OpenSSF Scorecard scores.
warn-on-openssf-scorecard-levelNononeNumeric threshold for the OpenSSF Scorecard score. If the score is below this threshold, the action will warn you.
show-patched-versionsNononeWhen set to `true`, the vulnerability summary table will include a column showing the first patched version for each vulnerability.

Outputs

NameDescription
comment-contentPrepared dependency report comment
dependency-changesAll dependency changes (JSON)
vulnerable-changesVulnerable dependency changes (JSON)
invalid-license-changesInvalid license dependency changes (JSON)
denied-changesDenied 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: high

Each 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.