Skip to content

Run Terraform Plan Before Merge

Ghost User requested to merge main into production

Updates gitlab-ci.yml to run terraform plan before merge.

Terraform plan must be run on a trusted runner, so the pipeline must be on a protected branch. Merge request pipelines cannot be run on trusted runners, so it must be run on a branch pipeline.

A new protected branch, "production", will be created. Merges into the "main" branch will have a postmerge job which runs terraform plan, and another manual job called "merge-and-deploy". After reviewing the terraform plan output, the merge-and-deploy job can be manually triggered to automatically merge into the "production" branch and run terraform apply to deploy.

Merge request reports