forked from OAI/OpenAPI-Specification
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTerraform workflow
47 lines (42 loc) · 1.1 KB
/
Terraform workflow
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
workflow "Terraform" {
resolves = "terraform-plan"
on = "pull_request"
}
action "filter-to-pr-open-synced" {
uses = "actions/bin/filter@master"
args = "action 'opened|synchronize'"
}
action "terraform-fmt" {
uses = "hashicorp/terraform-github-actions/fmt@v<latest version>"
needs = "filter-to-pr-open-synced"
secrets = ["GITHUB_TOKEN"]
env = {
TF_ACTION_WORKING_DIR = "."
}
}
action "terraform-init" {
uses = "hashicorp/terraform-github-actions/init@v<latest version>"
needs = "terraform-fmt"
secrets = ["GITHUB_TOKEN"]
env = {
TF_ACTION_WORKING_DIR = "."
}
}
action "terraform-validate" {
uses = "hashicorp/terraform-github-actions/validate@v<latest version>"
needs = "terraform-init"
secrets = ["GITHUB_TOKEN"]
env = {
TF_ACTION_WORKING_DIR = "."
}
}
action "terraform-plan" {
uses = "hashicorp/terraform-github-actions/plan@v<latest version>"
needs = "terraform-validate"
secrets = ["GITHUB_TOKEN"]
env = {
TF_ACTION_WORKING_DIR = "."
# If you're using Terraform workspaces, set this to the workspace name.
TF_ACTION_WORKSPACE = "default"
}
}