Skip to main content
Custoden Check runs on pull requests, pushes and merge queues. It finds what changed and checks:
  • New and upgraded npm and PyPI packages in your lockfiles
  • New and changed workflow files
  • New and changed files that run during CI, such as package.json scripts, conftest.py, setup.py, Makefiles and shell scripts
It annotates the affected lines, writes a job summary, can comment on the pull request, and fails when something crosses your threshold.

Gate your jobs

Make the jobs that install dependencies or run code depend on Custoden. When it fails, they never start.
.github/workflows/ci.yml

Guard every pull request

A pull request can edit the workflows it triggers, including the one above. A guard on pull_request_target runs from your default branch instead, so the pull request cannot change it. The action reads the changed files through the GitHub API and never checks out or runs them.
.github/workflows/custoden-guard.yml
When the check fails, cancel-runs cancels every other run for the pull request’s commit, including workflows the pull request added, and lists them in the comment.
Never add a checkout of the pull request head to a pull_request_target workflow. That is the misconfiguration prt-scan exploited.

If a pull request removes Custoden

A pull request can delete the gate from ci.yml, but not the guard. The guard reports custoden-removed when a workflow stops running Custoden or is deleted, and custoden-weakened when fewer jobs wait for it or it is set to never fail. Both are high, so the check fails and the pull request’s runs are cancelled.

What it stops

Cancelling is a race: a run that starts at the same moment as the guard can execute its first steps before it is stopped. Payloads that collect for a while before sending are usually stopped in time. Rotate any secret a cancelled run could read. Someone with write access can also push straight to a branch. Protect your default branch, require pull requests, and keep deployment secrets in environments with required reviewers. Do not rely on required status checks alone: wfx-loot posted forged success statuses for the check names repositories required.

Inputs and outputs

See the README for every input and output.