-
Label Detection Workflow (
.github/workflows/label-enforcement.yml)- Automatically detects
testingandsecuritylabels on PRs - Triggers on PR open, sync, label, and unlabel events
- Runs on both
mainanddevelopbranches
- Automatically detects
-
Extended Testing Checks (triggered by
testinglabel)- Full test suite execution
- Strict coverage validation with
npm run test:coverage - Coverage report validation
- Fails PR if any check doesn't pass
-
Extended Security Checks (triggered by
securitylabel)- Strict dependency audit (moderate level, not just critical)
- Zero-tolerance security linting (--max-warnings=0)
- Hardcoded secrets detection via grep patterns
- Environment variable usage validation
- Fails PR if any vulnerability or issue is found
-
Documentation (
docs/LABEL_ENFORCEMENT.md)- Complete usage guide for contributors and reviewers
- Failure scenarios and troubleshooting
- Examples and configuration details
- Linked from main README.md
✅ Test/security PRs receive deeper checks
testinglabel: Extended test suite + strict coveragesecuritylabel: Enhanced security scanning + zero warnings
✅ CI behavior is documented
- Comprehensive documentation in
docs/LABEL_ENFORCEMENT.md - README.md updated with link to documentation
- Inline comments in workflow file
✅ Detect PR labels
- Automatic detection using GitHub Actions expressions
- Outputs passed to dependent jobs
✅ Run extended test/security checks
- Conditional job execution based on labels
- Separate jobs for testing and security
✅ Fail PRs that don't meet stricter rules
- Enforcement status job validates all checks
- Non-zero exit codes on failures
- Clear error messages in logs
Add label to PR:
gh pr create --label testing
gh pr create --label securityOr via GitHub UI:
- Open PR page
- Click "Labels" in right sidebar
- Select
testingorsecurity
- Create a test PR with
testinglabel - should run extended test suite - Create a test PR with
securitylabel - should run enhanced security checks - Create a PR without labels - should only run standard CI
- Add/remove labels on existing PR - should trigger/skip extended checks
.github/workflows/label-enforcement.yml(new)docs/LABEL_ENFORCEMENT.md(new)README.md(updated)