- 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.jsonscripts,conftest.py,setup.py, Makefiles and shell scripts
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 onpull_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
cancel-runs cancels every other run for the pull request’s commit, including workflows the pull request added, and lists them in the comment.
If a pull request removes Custoden
A pull request can delete the gate fromci.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.