-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (49 loc) · 1.52 KB
/
pr_validation.yaml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
name: pr validation terraform
on:
pull_request:
branches: [main]
workflow_dispatch:
env:
AWS_ACCESS_KEY_ID: "${{secrets.AWS_ACCESS_KEY_ID}}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
AWS_REGION: "${{ secrets.AWS_REGION }}"
concurrency:
group: ${{github.workflow}}
cancel-in-progress: true
jobs:
terraform-plan:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest]
terraform: [0.14.8]
steps:
- name: checkout 🛎
uses: actions/checkout@master
- name: Aws credentions
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ env.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ env.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.AWS_REGION }}
- name: Setup Terrafom
uses: hashicorp/[email protected]
with:
terraform_version: ${{ matrix.terraform }}
- name: Terraform Init
id: tf_init
run: terraform init
- name: Terraform Validade
id: tf_validate
run: terraform validate -no-color
- name: terraform plan
id: tf-plan
run: terraform plan -out=plan.out -input=false -lock=false
continue-on-error: true
- name: terraform show plan
id: tf_show
run: terraform show -no-color plan.out
continue-on-error: true
- name: Terraform Plan Status
if: steps.tf_plan.outcome == 'failure'
run: exit 1