Dependency Diff Action
Codecov for dependencies — Visualize dependency changes on every pull request with before/after tower diffs, vulnerability scanning, and health grading.
On every PR that touches a dependency file:
Free to use
The GitHub Action uses the Stacktower API and requires a free account with an API key. Renders and diffs count toward your monthly fair-use limits. Triage AI investigations (investigate: true) use your 1 free AI analysis per month.
Setup
Create a free account
Sign up at app.stacktower.io. API access is free for every account.
Create an API key
Go to Settings → API Keys and create a key with visualizations:write and visualizations:read scopes. If you plan to use investigate: true, also add investigations:write and investigations:read.
Add the secret to your repository
In your GitHub repo, go to Settings → Secrets and variables → Actions and add a new repository secret:
STACKTOWER_API_KEYAdd the workflow file
Create .github/workflows/dependency-diff.yml in your repository:
# .github/workflows/dependency-diff.ymlname: Dependency Diffon:pull_request:paths:- 'package.json'- 'package-lock.json'- 'yarn.lock'- 'pnpm-lock.yaml'- 'poetry.lock'- 'pyproject.toml'- 'uv.lock'- 'requirements.txt'- 'Cargo.toml'- 'Cargo.lock'- 'go.mod'- 'Gemfile'- 'Gemfile.lock'- 'composer.json'- 'composer.lock'- 'pom.xml'- 'build.gradle'- 'build.gradle.kts'jobs:tower-diff:runs-on: ubuntu-latestpermissions:pull-requests: writesteps:- uses: actions/checkout@v4- uses: stacktower-io/stacktower-action@v1with:api-key: ${{ secrets.STACKTOWER_API_KEY }}
What you get on every PR
The action posts a rich comment on your pull request that automatically updates on subsequent pushes (no duplicate comments).
Summary bar
Added, removed, updated, unchanged counts
Health comparison
Before/after stats (deps, depth, vulns, licenses)
Package changes
Detailed lists with version info
New vulnerabilities
Highlighted with severity badges
Tower images
Side-by-side before/after linking to interactive viewer
Investigation report
Health grade A-F with prioritized recommendations (optional)
Multi-language PR example
If a PR updates both frontend/package-lock.json and backend/go.mod, the action posts two Stacktower comments (one per manifest path). Each comment is updated independently on subsequent pushes.
Inputs
api-key*manifestfail-on-vulnfalsefail-on-licensefalsefail-on-brittlefalsesecurity-scantrueinvestigatefalsecommenttruetoken${{ github.token }}api-base-urlhttps://api.stacktower.io/v1app-base-urlhttps://app.stacktower.ioOutputs
has-changesWhether dependency changes were detecteddiff-jsonJSON diff resultnew-vulnsNumber of new vulnerabilities introducedbefore-render-idRender ID for the before towerafter-render-idRender ID for the after towerbefore-urlURL to the before tower on app.stacktower.ioafter-urlURL to the after tower on app.stacktower.iolicense-issuesNumber of license issues in the after renderbrittle-depsNumber of brittle dependencies in the after renderhealth-gradeDependency health grade (A-F) from Triage AIinvestigation-jsonFull Triage AI investigation report as JSONSupported Languages
When both a lockfile and manifest change for the same language, the lockfile is preferred (it has fully resolved versions).
Workflow Examples
Fail on new vulnerabilities
Block merges when new vulnerabilities are introduced. Integrates with GitHub branch protection rules.
- uses: stacktower-io/stacktower-action@v1with:api-key: ${{ secrets.STACKTOWER_API_KEY }}fail-on-vuln: true
Full dependency quality gate
Gate on vulnerabilities, license compliance, and dependency health all at once.
- uses: stacktower-io/stacktower-action@v1with:api-key: ${{ secrets.STACKTOWER_API_KEY }}fail-on-vuln: truefail-on-license: truefail-on-brittle: true
Triage AI Investigation
Run the Triage agent on the after-PR dependency tree for a health grade (A-F) and prioritized recommendations.
- uses: stacktower-io/stacktower-action@v1id: depswith:api-key: ${{ secrets.STACKTOWER_API_KEY }}investigate: truefail-on-vuln: true- run: echo "Health grade: ${{ steps.deps.outputs.health-grade }}"
token input must have read access to the repo.Usage per run
Each action run counts toward your monthly fair-use limits. Here's what each run uses:
2 rendersBefore and after tower visualizations1 diffComparing the two renders for changes1 investigationOnly if investigate: true (uses 1 Triage AI analysis)Every account gets 1 Triage AI analysis per month, so you may want to leave investigate off for routine PRs. You can check your current usage under Settings.