/
action.yml
46 lines (40 loc) · 1.14 KB
/
action.yml
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
name: Execute terraform plan
description: Execute terraform plan
inputs:
flags:
description: The flags to pass to terraform plan
required: false
default: ""
cli_config_credentials_token:
description: The CLI config credentials token to use for deployment.
required: true
dry-run:
description: If true, just runs terraform plan
default: "false"
required: false
runs:
using: composite
steps:
- uses: actions/checkout@v3.5
- uses: hashicorp/setup-terraform@v2
with:
cli_config_credentials_token: ${{ inputs.cli_config_credentials_token }}
terraform_wrapper: false
- name: Terraform Init
shell: bash
id: init
run: terraform init
- name: Terraform Validate
shell: bash
id: validate
run: terraform validate -no-color
- name: Terraform Plan
if: ${{ inputs.dry-run == 'true' }}
id: plan
shell: bash
run: terraform plan -no-color ${{ inputs.flags }}
- name: Terraform Apply
if: ${{ inputs.dry-run == 'false' }}
id: apply
shell: bash
run: terraform apply -no-color ${{ inputs.flags }} -auto-approve