Skip to content

Instantly share code, notes, and snippets.

@zytek
Last active February 8, 2022 12:09
Show Gist options
  • Save zytek/1d82ec0d7fdff09110765c451fd54129 to your computer and use it in GitHub Desktop.
Save zytek/1d82ec0d7fdff09110765c451fd54129 to your computer and use it in GitHub Desktop.
Terraform FMT check on Github Pull Requests via atlantis
# This will run terraform fmt check on pull requests before planning
# Requires atlantis >= 0.4.15
version: 2
automerge: true
projects:
- name: myproject
dir: .
workspace: default
terraform_version: v0.11.11
apply_requirements: [mergeable, approved]
workflow: myworkflow
workflows:
myworkflow:
plan:
steps:
- run: terraform fmt -check=true -diff=true -write=false
- init
- plan
apply:
steps:
- apply
@zytek
Copy link
Author

zytek commented Feb 22, 2019

@bradleydamato
Copy link

Note: runatlantis/atlantis#490

I see this issue and the related issue were closed. Are you still running terraform fmt in the above way?

@Jenishk56
Copy link

This takes the default terraform version instead something what Atlantis can define.
e.g. /usr/local/bin/terraform0.13.7

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment