PRs labeled with testing or security automatically trigger additional CI checks beyond the standard pipeline.
Triggers extended test suite with:
- Full test execution
- Strict coverage validation
- Coverage report generation and validation
Triggers enhanced security checks with:
- Strict dependency audit (moderate level)
- Zero-tolerance security linting (--max-warnings=0)
- Hardcoded secrets detection
- Environment variable usage validation
- Label Detection: Automatically detects when PR is labeled/unlabeled
- Conditional Execution: Runs extended checks only when relevant labels are present
- Strict Enforcement: PRs fail if extended checks don't pass
Add labels when creating/updating PRs:
# Via GitHub CLI
gh pr create --label testing
gh pr create --label security
# Or add labels to existing PR
gh pr edit <PR_NUMBER> --add-label testingLabels can be added through GitHub UI or CLI to trigger additional validation.
The label enforcement workflow runs alongside the standard CI pipeline:
Standard CI (always runs)
├── Test
├── Coverage
├── Lint
└── Security
Label-Based CI (conditional)
├── Extended Testing (if 'testing' label)
└── Extended Security (if 'security' label)
- Test suite fails
- Coverage thresholds not met
- Coverage report not generated
- Dependencies with moderate+ vulnerabilities
- Any security linting warnings
- Hardcoded secrets detected
- Suspicious environment variable usage
Workflow file: .github/workflows/label-enforcement.yml
Modify thresholds or checks by editing the workflow file.
# PR with testing label runs:
- npm test (full suite)
- npm run test:coverage (with validation)
- Coverage report validation# PR with security label runs:
- npm audit --audit-level=moderate
- npm run lint:security --max-warnings=0
- Hardcoded secrets scan
- Environment variable validationExtended checks not running?
- Verify label is exactly
testingorsecurity(case-sensitive) - Check workflow run logs in Actions tab
Checks failing unexpectedly?
- Review specific failure in workflow logs
- Extended checks are stricter than standard CI
- Fix issues or remove label if not applicable