-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (43 loc) · 1.17 KB
/
build.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
---
name: Build
'on':
push:
branches:
- main
tags:
- "**"
pull_request_target:
jobs:
build:
name: Build
runs-on: ubuntu-22.04
env:
TERRAFORM_VERSION: 1.3.4
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Download Terraform
run: "./scripts/download_terraform.sh $TERRAFORM_VERSION"
- name: Init workspace
run: "~/tfbin/terraform init -upgrade -input=false"
- name: Check format
run: "~/tfbin/terraform fmt -write=false -diff=true -check"
- name: Run Trivy
uses: aquasecurity/trivy-action@master
with:
scan-type: 'config'
hide-progress: false
exit-code: '1'
- name: Check plan
run: "~/tfbin/terraform plan -detailed-exitcode -input=false"
env:
AWS_ACCESS_KEY_ID: "${{ secrets.AWS_ACCESS_KEY_ID }}"
AWS_SECRET_ACCESS_KEY: "${{ secrets.AWS_SECRET_ACCESS_KEY }}"
- name: Post to hook-exporter
run: "./.github/exporter.sh"
env:
EXPORTER_TOKEN: "${{ secrets.EXPORTER_TOKEN }}"
JOB_STATUS: "${{ job.status }}"
if: always() && github.ref == 'refs/heads/main'