generated from evrone/go-clean-template
-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (41 loc) · 1.08 KB
/
conftest.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
name: "Conftest"
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
jobs:
run-conftest:
name: Run conftest
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Find tfvars
id: find_tfvars
run: |
tfvars=$(find . -name '*.tfvars' | tr '\n' ' ')
echo "tfvars=$tfvars"
echo "tfvars=$tfvars" >> $GITHUB_OUTPUT
- name: Run conftest test against changed files
uses: jtbonhomme/action-conftest@master
id: conftest
# if: steps.find_tfvars.outputs.tfvars
with:
files: ${{ steps.find_tfvars.outputs.tfvars }}
data: 'policy/data.json'
policy: 'policy'
- name: Post conftest command result to GitHub comment
uses: b4b4r07/action-github-comment@master
if: always() && steps.conftest.outputs.result
with:
body: |
## conftest test result
```
${{ steps.conftest.outputs.result }}
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
LOG: trace