File tree Expand file tree Collapse file tree 3 files changed +55
-5
lines changed Expand file tree Collapse file tree 3 files changed +55
-5
lines changed Original file line number Diff line number Diff line change 1
1
version : 2
2
2
updates :
3
- - package-ecosystem : " gitlab -actions"
3
+ - package-ecosystem : " github -actions"
4
4
directory : " /"
5
5
schedule :
6
6
interval : " weekly"
Original file line number Diff line number Diff line change 12
12
validate :
13
13
name : Validate
14
14
runs-on : ubuntu-latest
15
+ permissions :
16
+ pull-requests : write
15
17
strategy :
16
18
fail-fast : true
17
19
matrix :
50
52
tflint :
51
53
name : tflint
52
54
runs-on : ubuntu-latest
55
+ permissions :
56
+ pull-requests : write
53
57
needs : [validate]
54
58
steps :
55
59
- name : Checkout code
62
66
- uses : terraform-linters/setup-tflint@v2
63
67
name : Setup TFLint
64
68
with :
65
- github_token : ${{ secrets.GITHUB_TOKEN }}
69
+ github_token : ${{ github.token }}
66
70
tflint_version : latest
67
71
- name : Run TFLint
68
72
run : |
72
76
tfsec :
73
77
name : tfsec
74
78
runs-on : ubuntu-latest
79
+ permissions :
80
+ pull-requests : write
75
81
needs : [validate]
76
82
steps :
77
83
- name : Checkout code
@@ -83,13 +89,13 @@ jobs:
83
89
version : " latest"
84
90
85
91
caller-identity-check :
86
- if : ${{ github.event_name == 'pull_request' }}
92
+ if : contains(github.event_name, 'pull_request')
93
+ runs-on : ubuntu-latest
87
94
name : Return the IAM user
88
95
needs : [validate, tflint, tfsec]
89
96
permissions :
90
97
contents : read
91
98
id-token : write
92
- runs-on : ubuntu-latest
93
99
steps :
94
100
- name : Configure AWS credentials
95
101
uses : aws-actions/configure-aws-credentials@v1
@@ -100,13 +106,14 @@ jobs:
100
106
aws sts get-caller-identity
101
107
102
108
auto-approve :
103
- if : ${{ github.event_name == 'pull_request' }}
109
+ if : contains( github.event_name, 'pull_request')
104
110
runs-on : ubuntu-latest
105
111
needs : [validate, tfsec, caller-identity-check]
106
112
steps :
107
113
- name : Auto Approve PR
108
114
uses : actions/github-script@v6
109
115
with :
116
+ github-token : ${{ github.token }}
110
117
script : |
111
118
github.rest.pulls.createReview({
112
119
owner: context.repo.owner,
Original file line number Diff line number Diff line change
1
+ name : tfsec
2
+
3
+ on :
4
+ push :
5
+ branches : [ "main" ]
6
+ pull_request :
7
+ branches : [ "main" ]
8
+ schedule :
9
+ - cron : ' 33 21 * * 1'
10
+
11
+ jobs :
12
+ tfsec :
13
+ name : Run tfsec sarif report
14
+ runs-on : ubuntu-latest
15
+ permissions :
16
+ actions : read
17
+ contents : read
18
+ security-events : write
19
+ steps :
20
+ - name : Clone repo
21
+ uses : actions/checkout@v3
22
+ - name : Run tfsec
23
+ uses : aquasecurity/tfsec-sarif-action@master
24
+ with :
25
+ sarif_file : tfsec.sarif
26
+ - name : Upload SARIF file
27
+ uses : github/codeql-action/upload-sarif@v2
28
+ with :
29
+ sarif_file : tfsec.sarif
30
+
31
+ remote :
32
+ name : Remote exmaple test
33
+ runs-on : ubuntu-latest
34
+ steps :
35
+ - name : Clone repo
36
+ uses : actions/checkout@v3
37
+ - name : Setup Terraform
38
+ uses : hashicorp/setup-terraform@v2
39
+ - name : Exmaple Remote Validate
40
+ run : |
41
+ cd exmaples/remote
42
+ terraform init -backend=false -upgrade -reconfigure
43
+ terraform validate
You can’t perform that action at this time.
0 commit comments