-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
44 lines (37 loc) · 1.25 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
---
name: Terraform Plan
description: Terraform Plan
inputs:
GITHUB_TOKEN:
description: サードパーティの Action を実行するための権限を付与するための認証用トークン
required: true
working-directory:
description: Terraform CLI 実行時のパス
required: true
runs:
using: composite
steps:
- name: Setup Terraform
uses: ./.github/actions/setup-terraform
with:
working-directory: ${{ inputs.working-directory }}
- name: Terraform Validate
uses: ./.github/actions/terraform-validate
with:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
working-directory: ${{ inputs.working-directory }}
- name: Setup tfcmt
uses: itkq/actions-tfcmt/setup@main
- name: Terraform Plan
id: terraform-plan
run: |
TARGET=$(echo ${{ inputs.working-directory }} | sed -e 's|^.*terraform/src/||' | cut -c 1-36)
tfcmt --var target:$TARGET plan -patch -- terraform plan -no-color
env:
GITHUB_TOKEN: ${{ inputs.GITHUB_TOKEN }}
working-directory: ${{ inputs.working-directory }}
shell: bash
- name: Terraform Plan (failure) -> Status
if: steps.terraform-plan.outcome == 'failure'
run: exit 1
shell: bash