DEVOPS

Block PR merges when the Vercel bundle exceeds budget

On every pull request, builds the app, compares total client bundle size against a baseline budget.

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerevent
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitHub PR opened or updatedGitHubGitHub
  • ActionBuild app and measure gzipped bundleShell
  • LogicCompare bundle size to baseline budget
  • ActionSet pass/fail GitHub commit status checkGitHubGitHub
  • OutputPost result summary to SlackSlack

What it does

This gate stops bundle bloat from reaching production. When a pull request opens or updates, it builds the branch, measures the gzipped client bundle, and compares it against the budget you set (for example, no more than a 5% increase over the current main baseline). If the bundle grows past that line, the PR's required status check turns red and the merge button locks. A passing build flips the check green automatically.

When to use it

Use it on any Next.js or front-end repo on Vercel where page weight matters for performance and Core Web Vitals. It's the cleanest way to make bundle size a hard merge requirement rather than a thing people notice after shipping.

How it works

  1. 1A GitHub pull_request event fires when a PR opens or gets new commits.
  2. 2A shell step runs the production build and extracts the total gzipped bundle size from the build manifest.
  3. 3A logic step compares the new size against the stored baseline and computes the percent delta.
  4. 4If the delta exceeds the threshold, the flow posts a failing GitHub commit status; otherwise it posts a passing one.
  5. 5A Slack message summarizes the result with the exact byte delta and a link to the PR.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Connect ShellRun sandboxed commands inside the workspace.
  3. 3
    Connect SlackChannels, DMs, threads, mentions.
  4. 4
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  5. 5
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  6. 6
    Test, then turn it onRun once against a sample, confirm the output, then enable the trigger.

Run this workflow in your colony.

14-day trial. No DevOps. No Sales call. Provisioned in under a minute.