ci: skip normal CI/CodeQL on release-please PRs#65
Conversation
Release-please PRs only touch CHANGELOG/manifest/version files and are re-validated on main after merge, so running the full test/lint/e2e/codeql suite on them just burns runners. Guard the PR-running jobs with `!startsWith(github.head_ref, 'release-please--')` (head_ref is empty on push, so main is unaffected; integration/kotlin-builder already skip all PRs). No status checks are required on main, so this doesn't block the release PR merge. Signed-off-by: Sam Gammon <sam@elide.dev>
Merging this PR will not alter performance
|
The previous guard keyed only on github.head_ref, which a fork PR controls — a branch named `release-please--evil` would skip CI/CodeQL on that PR. Add a same-repo condition (head.repo.full_name == github.repository) so only genuine release-please branches (which only exist on our own repo) skip; fork PRs always run the full suite. Signed-off-by: Sam Gammon <sam@elide.dev>
There was a problem hiding this comment.
Pull request overview
Adjusts GitHub Actions workflows to skip running expensive PR-only CI and CodeQL analysis for same-repo release-please--* pull requests, reducing runner usage while relying on validation after merge to main.
Changes:
- Add job-level guards to skip CI jobs for same-repo
release-please--*PR branches. - Add a similar guard to CodeQL analysis to skip same-repo
release-please--*PRs while still running onpush/scheduleand fork PRs. - Extend the existing same-repo RBE gating to also skip release-please PR branches.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| .github/workflows/ci.yml | Adds if: conditions to skip CI jobs for same-repo release-please PRs. |
| .github/workflows/codeql.yml | Adds if: condition to skip CodeQL on same-repo release-please PRs (still runs on push/schedule). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Restructure the CI/CodeQL skip conditions to "skip only when it's a same-repo release-please pull_request": `!(event_name == 'pull_request' && head.repo == this repo && startsWith(head_ref, 'release-please--'))`. GitHub expressions are null-safe so the prior form wouldn't actually fail on push/schedule, but the event_name guard is clearer and matches the repo convention (benchmarks.yml). Signed-off-by: Sam Gammon <sam@elide.dev>
Release-please PRs only edit CHANGELOG/manifest/version files and are re-validated on
mainafter merge, so running the full suite on them wastes runners.Guards the PR-running jobs in
ci.yml(tests, e2e, lint, docs-freshness, rbe) andcodeql.ymlwith!startsWith(github.head_ref, 'release-please--').head_refis empty on push events, somainis unaffected;integration/kotlin-builderalready skip all PRs. No required status checks onmain, so the release PR can still merge.