Run CI before code reaches main.
Section: Branching and trigger patterns
Validate pull requests only
yaml
yaml
on:
pull_request:
branches: [main]Explanation
PR validation is the safest default for lint, unit tests, type checks, and build verification.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Branching and trigger patterns
Deploy only from main
Restrict production deployment to your protected main branch.
Nightly scheduled workflow
Run audits, backups, smoke tests, or dependency checks on a schedule.
Minimal Jenkins declarative pipeline
Run checkout, install, test, and build in a Jenkinsfile.