CICD-086 · Validate generated assets are committed
Encyclopedia · Tests and quality checks · All snippets
Previous · CICD-085 · Next · CICD-087
1. Where it fits
- Placement Bash run step following checkout, or equivalent lab terminal.
- Prerequisites repository with test fixtures and task-specific quality dependencies.
- Platforms local-linux, github-actions, gitea-actions.
2. Copy the snippet
bash
npm run generate
git diff --exit-code -- generated/
test -z "$(git ls-files --others --exclude-standard -- generated/)"3. How it works
Git computes a source difference over the selected paths or revisions. Choose an available base ref with the intended merge relationship. The shell predicate makes the expected state explicit and returns a nonzero status when it is not satisfied.
4. Verify the result
Detect both modified and newly generated tracked-scope files.
Validation syntax-validated (Bash parse). Status definitions.