Skip to content

perf(ci): skip frontend CI when nothing it builds changed - #391

Merged
nourshoreibah merged 2 commits into
mainfrom
worktree-frontend-ci-path-filter
Aug 30, 2026
Merged

nourshoreibah merged 2 commits into
mainfrom
worktree-frontend-ci-path-filter

Conversation

@nourshoreibah

Copy link
Copy Markdown
Collaborator

Infra- and lambda-only PRs were paying for a full npm ci, typecheck, lint, next build and jest run in apps/frontend. Now they skip it.

Why not a paths: filter

frontend-ci is a required status check on main. A workflow that never starts never reports, so a workflow-level paths: filter leaves the check pending forever and blocks the merge. A job skipped by if: reports skipped, which GitHub accepts as passing — so the filtering lives in a cheap changes job that gates the real one.

merge_group does not support paths: at all; diffing against github.event.merge_group.base_sha covers the merge queue too.

What counts as a frontend change

  • apps/frontend/**
  • shared/** — build-shared-packages builds every shared package, so any of them can break this job, not just @branch/rbac
  • .github/actions/build-shared-packages/**
  • .github/workflows/frontend-ci.yml

Without a usable base sha the gate fails open and runs the job.

Verification

Ran the gate script locally against real history:

  • base cff8a41 (infra-only range) → frontend=false
  • base c666ff0 (range touching apps/frontend/src/lib/queries.ts) → frontend=true
  • nonexistent base sha → frontend=true (fail open)

Draft until it has been seen run green on a PR that does touch the frontend.

🤖 Generated with Claude Code

nourshoreibah and others added 2 commits August 30, 2026 15:27
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
nourshoreibah marked this pull request as ready for review August 30, 2026 19:30
github-actions Bot added a commit that referenced this pull request Aug 30, 2026
@nourshoreibah nourshoreibah added the no-review The PR review bot won't run label Aug 30, 2026
github-actions Bot added a commit that referenced this pull request Aug 30, 2026
@nourshoreibah
nourshoreibah merged commit 3c702a4 into main Aug 30, 2026
19 checks passed
@nourshoreibah
nourshoreibah deleted the worktree-frontend-ci-path-filter branch August 30, 2026 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-review The PR review bot won't run

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant