perf(ci): skip frontend CI when nothing it builds changed - #391
Merged
Merged
Conversation
Infra- and lambda-only PRs were paying for a full npm ci, typecheck, lint, next build and jest run in apps/frontend. frontend-ci is a required status check, so a workflow-level `paths:` filter is not an option -- a workflow that never starts leaves the check pending forever and blocks the merge. A job skipped by `if:` reports "skipped", which satisfies the requirement, so a cheap `changes` job diffs the PR (or merge group) against its base and gates the real job on the result. The filter covers shared/ in full rather than just shared/rbac, because build-shared-packages builds every shared package and any of them can break this job. Without a usable base sha the gate fails open. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
nourshoreibah
marked this pull request as ready for review
August 30, 2026 19:30
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Infra- and lambda-only PRs were paying for a full
npm ci, typecheck, lint,next buildand jest run inapps/frontend. Now they skip it.Why not a
paths:filterfrontend-ciis a required status check onmain. A workflow that never starts never reports, so a workflow-levelpaths:filter leaves the check pending forever and blocks the merge. A job skipped byif:reportsskipped, which GitHub accepts as passing — so the filtering lives in a cheapchangesjob that gates the real one.merge_groupdoes not supportpaths:at all; diffing againstgithub.event.merge_group.base_shacovers the merge queue too.What counts as a frontend change
apps/frontend/**shared/**—build-shared-packagesbuilds every shared package, so any of them can break this job, not just@branch/rbac.github/actions/build-shared-packages/**.github/workflows/frontend-ci.ymlWithout a usable base sha the gate fails open and runs the job.
Verification
Ran the gate script locally against real history:
cff8a41(infra-only range) →frontend=falsec666ff0(range touchingapps/frontend/src/lib/queries.ts) →frontend=truefrontend=true(fail open)Draft until it has been seen run green on a PR that does touch the frontend.
🤖 Generated with Claude Code