name: Dependency Review

# Blocks PRs that introduce new transitive dependencies with known
# high-or-critical CVEs. The check runs against the diff of the PR's
# manifest files (package.json / package-lock.json) and the base branch,
# so existing vulnerabilities (tracked in security/vex/sencho.openvex.json
# and Trivy) are not re-flagged here.

on:
  pull_request:
    branches: [main]

permissions:
  contents: read
  pull-requests: write

concurrency:
  group: dependency-review-${{ github.ref }}
  cancel-in-progress: true

jobs:
  dependency-review:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
      - name: Run dependency review
        uses: actions/dependency-review-action@a1d282b36b6f3519aa1f3fc636f609c47dddb294 # v5.0.0
        with:
          fail-on-severity: high
          comment-summary-in-pr: on-failure
