DEVOPS

PR Terraform Plan Gate with Drift-Aware GitHub Comment

On every infrastructure pull request, runs terraform plan, warns inline if the PR collides with un-reconciled live drift, and posts the full plan as a GitHub comment before merge.

CategoryDevOps
Enginesim
Difficultyadvanced
Triggerevent
Steps5
Setup~25 min

How it runs

The automated pipeline, trigger to output.

  • TriggerGitHub pull_request opened/syncedGitHubGitHub
  • ActionRun terraform plan for PR branchShell
  • LogicCompare touched resources vs drift set
  • LogicFlag overlap with un-reconciled drift
  • OutputPost/update GitHub PR plan commentGitHubGitHub

What it does

When an infra pull request opens or updates, this workflow runs `terraform plan` against current live state, detects whether the PR's changes overlap resources that have already drifted out-of-band, and posts a GitHub comment with the plan plus a prominent warning if merging would silently overwrite that live drift.

When to use it

Use it when reviewers approve Terraform PRs without realizing live infrastructure has changed since the branch was cut. The gate prevents an apply from clobbering an emergency console fix that nobody imported back into state.

How it works

  1. 1A GitHub trigger fires on pull_request opened or synchronized for infra paths.
  2. 2A shell action runs `terraform plan` for the PR branch against live state.
  3. 3A logic step compares the plan's touched resources against the current drift set.
  4. 4A logic step sets a warning flag when the PR overlaps un-reconciled drift.
  5. 5An output step posts (or updates) a single GitHub PR comment with the plan summary and, if flagged, a blocking drift warning and the conflicting resource list.

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
    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.