DEVOPS

Block expensive BigQuery queries on PR open with a dry-run cost comment

On every PR open or sync, dry-runs changed queries against BigQuery and posts a pass/fail cost comment, blocking merge when any query exceeds the budget.

CategoryDevOps
Enginesim
Difficultyintermediate
Triggerevent
Steps5
Setup~15 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitHub PR opened or synchronizedGitHubGitHub
  • ActionFetch changed .sql files from the PRGitHubGitHub
  • ActionDry-run each query in BigQueryGoogle BigQueryBigQuery
  • LogicEvaluate pass/fail against byte budget
  • OutputPost blocking status check commentGitHubGitHub

What it does

This is a pre-merge gate. When a pull request opens or gets new commits, it dry-runs each changed query against BigQuery, then writes a single GitHub check comment summarizing estimated bytes and cost per query. If any query is over budget, the comment fails the check so the PR cannot merge until it is fixed.

When to use it

Use it when you want to stop costly queries before they reach the main branch rather than filing cleanup tasks after the fact. It gives authors immediate, inline feedback while the change is still in review.

How it works

  1. 1A GitHub pull request opened or synchronized event triggers the flow.
  2. 2The flow fetches changed .sql files from the PR.
  3. 3Each query runs as a BigQuery dry run for an estimated-bytes figure.
  4. 4A logic step marks the PR pass or fail against the byte budget.
  5. 5A status check comment is posted back to the PR with per-query costs and an overall verdict that blocks merge on failure.

Set it up

What you configure once, before turning it on.

  1. 1
    Connect GitHubRepos, issues, pull requests, actions.
  2. 2
    Connect BigQueryDatasets, queries, schemas.
  3. 3
    Set each agent's modelWe leave models unset so you pick the tier — fast + cheap, or top-quality.
  4. 4
    Tune it to your dataEdit the prompts, filters, and field mappings so it matches how your team works.
  5. 5
    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.