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:
Requires Pro plan
The GitHub Action uses the Stacktower API and requires an API key, which is available on the Pro plan ($9/month). Each render and diff consumes API credits from your plan quota.
Setup
Sign up and upgrade to Pro
Create an account at app.stacktower.io and upgrade to Pro to unlock API access.
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.API Credit Usage
Each action run uses API credits from your Pro plan. Here's what each run consumes:
2 rendersBefore and after tower visualizations1 diffComparing the two renders for changes1 investigationOnly if investigate: true (uses 1 Triage AI analysis)Pro plan includes 200 renders and 20 Triage AI analyses per month. A typical team with 20 dependency PRs/month would use about 40 renders, well within limits.