diff --git a/.github/main.workflow b/.github/main.workflow index 4a1e0ed..69ac724 100644 --- a/.github/main.workflow +++ b/.github/main.workflow @@ -1,5 +1,5 @@ workflow "Terraform" { - resolves = "terraform-plan" + resolves = "terraform-fmt" on = "pull_request" } @@ -16,3 +16,21 @@ action "terraform-fmt" { TF_ACTION_WORKING_DIR = "." } } + +action "terraform-init" { + uses = "hashicorp/terraform-github-actions/init@v0.2.0" + needs = "terraform-fmt" + secrets = ["GITHUB_TOKEN"] + env = { + TF_ACTION_WORKING_DIR = "." + } +} + +action "terraform-validate" { + uses = "hashicorp/terraform-github-actions/validate@v0.2.0" + needs = "terraform-init" + secrets = ["GITHUB_TOKEN"] + env = { + TF_ACTION_WORKING_DIR = "." + } +} diff --git a/main.tf b/main.tf index 081c3f2..44a1951 100644 --- a/main.tf +++ b/main.tf @@ -18,4 +18,3 @@ resource "random_pet" "server" { length = "${var.pet_name_length}" } - diff --git a/variables.tf b/variables.tf index f3a9817..34a7c3b 100644 --- a/variables.tf +++ b/variables.tf @@ -4,4 +4,3 @@ variable "pet_name_length" { type = "string" default = "2" } -