This repository was archived by the owner on Jun 25, 2026. It is now read-only.
Repository navigation
Diff Sentinel is a GitHub Action that runs your generation or formatting commands, checks for uncommitted changes using git diff, and fails CI when the repository is out of sync.
Features
-
Run multiple commands before checking for diffs
-
Reliably detect uncommitted changes using
git diff -
Fail workflows when generated or formatted files are not committed
-
Clear, grouped logs in the GitHub Actions UI
-
Rich Job Summary explaining:
- what changed
- why the job failed
- how to fix it
-
Structured outputs for downstream steps:
has_diffchanged_filesdiff_countcommand_failures
Configuration Options
run(required) — Commands to execute before checking for diffsfail-message— Custom failure message shown in logs and the Job Summaryfail-on-command-error— Fail CI when any command failsfail-on-diff— Fail CI when uncommitted changes are detected
Why use Diff Sentinel?
Diff Sentinel helps prevent common CI issues caused by:
- forgotten generated files
- uncommitted formatting changes
- drifting build artifacts
- inconsistent derived files in pull requests
Instead of silently passing CI, Diff Sentinel provides immediate, actionable feedback to contributors.
Usage
- uses: teneplaysofficial/diff@v1
with:
run: |
pnpm build
pnpm gen
pnpm fmtSee the README for full usage examples and configuration details.
Full Changelog: https://github.com/teneplaysofficial/diff/commits/1.0.0