ci: pre-merge frontend build gate (closes #191)#232
Conversation
Add .github/workflows/frontend-build.yml — a pull_request-triggered job that runs npm run typecheck (tsc --noEmit) and npm run build (webpack) for any PR targeting feat/multicloud-web-frontend or main that touches frontend/** or the workflow file itself. Rationale for pull_request vs pull_request_target: pull_request_target executes in the base-branch context with access to repository secrets, making it a fork-exfiltration vector. pull_request is safe for untrusted-code builds — it runs in the PR-head context with no secrets. Paths filter restricts the gate to PRs that actually touch the frontend, avoiding wasted CI minutes on Go/Terraform-only PRs (~60s/run). Node version and action versions (checkout@v5, setup-node@v6, Node 24) match the existing frontend-build-sentinel.yml so both jobs run in the same environment. Concurrency group cancels stale runs on force-push. This is a companion to frontend-build-sentinel.yml (#177), not a replacement — the sentinel guards the protected branch post-merge (defence-in-depth for rebase/UI-merge slip-throughs); this gate catches failures before merge.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds a GitHub Actions workflow that automatically builds and typechecks the frontend on pull requests targeting specific branches, with concurrency control to cancel redundant runs. ChangesFrontend CI Workflow
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Possibly related PRs
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Review rate limit: 0/5 reviews remaining, refill in 57 minutes and 58 seconds. Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
.github/workflows/frontend-build.yml— apull_request-triggered job that runsnpm run typecheck(tsc --noEmit) andnpm run build(webpack) for any PR targetingfeat/multicloud-web-frontendormainthat touchesfrontend/**.frontend-build-sentinel.yml(ci: add a frontend-build sentinel workflow on push to protected branches #177, post-merge defence-in-depth); not a replacement.Security note:
pull_requestvspull_request_targetUses
pull_request(notpull_request_target).pull_request_targetruns with base-branch secrets and is a known fork-exfiltration vector.pull_requestruns in the PR-head context with no secrets — safe for untrusted-code builds.Paths filter
Restricts execution to PRs that touch
frontend/**or the workflow file itself. Avoids wasting ~60s of runner time on Go/Terraform-only PRs.Test plan
feat/multicloud-web-frontendthat changes a file infrontend/— confirm "Frontend build (PR)" check appears and passes.frontend/src/*.tsin a PR — confirm the check fails and blocks merge.Frontend build (PR)to branch protection required status checks forfeat/multicloud-web-frontendandmain.Summary by CodeRabbit