-
Notifications
You must be signed in to change notification settings - Fork 3
58 lines (56 loc) · 1.78 KB
/
pull_request.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
47
48
49
50
51
52
53
54
55
56
57
58
---
# yamllint disable rule:line-length
name: Pull Request
on:
pull_request:
workflow_dispatch:
env:
terraform: 0.15.0
tf_target_dir: example/examplea
jobs:
terraform:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ github.token }}
- name: Terraform Init
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: ${{ env.terraform }}
tf_actions_subcommand: init
tf_actions_working_dir: ${{ env.tf_target_dir }}
- name: Terraform Validate
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: ${{ env.terraform }}
tf_actions_subcommand: validate
tf_actions_working_dir: ${{ env.tf_target_dir }}
- name: Terraform Plan
uses: hashicorp/terraform-github-actions@master
with:
tf_actions_version: ${{ env.terraform }}
tf_actions_subcommand: plan
tf_actions_working_dir: ${{ env.tf_target_dir }}
env:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_KEY }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
security:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
token: ${{ github.token }}
- uses: actions/setup-python@v2
with:
python-version: 3.8
- run: |
pip3 install lastversion
lastversion terraform-docs --assets -d --verbose
mkdir $GITHUB_WORKSPACE/bin
tar -xvf terraform-docs*.tar.gz --directory $GITHUB_WORKSPACE/bin
chmod +x $GITHUB_WORKSPACE/bin/terraform-docs
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
- uses: pre-commit/action@v2.0.0