-
Notifications
You must be signed in to change notification settings - Fork 2
57 lines (56 loc) · 1.5 KB
/
pr.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
name: Test PR
on:
pull_request:
jobs:
lint-validate:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
- name: Init
run: terraform init
- name: Validate
run: terraform validate
- name: tfsec
uses: aquasecurity/[email protected]
with:
github_token: ${{ github.token }}
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
- name: Install tflint plugins
run: tflint --init
- name: Lint Terraform files
run: tflint
terratest:
runs-on: ubuntu-20.04
defaults:
run:
working-directory: tests
services:
localstack:
image: localstack/localstack
ports:
- 4566:4566
steps:
- uses: actions/checkout@v4
- uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
- uses: actions/setup-go@v5
- run: cp mocks/mock_provider.tf ../
- run: terraform -chdir=.. init
- name: terratest
run: go test
dependabot:
needs: [lint-validate, terratest]
permissions:
contents: write
pull-requests: write
runs-on: ubuntu-latest
if: ${{ github.actor == 'dependabot[bot]' }}
steps:
- name: Enable auto-merge for Dependabot PRs
run: gh pr merge --auto --rebase "$PR_URL"
env:
PR_URL: ${{github.event.pull_request.html_url}}
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}