Skip to content

Commit 1eb4e7e

Browse files
authored
switch to enable only format and validate (#105)
* switch to enable only format and validate * add switch to select format, lint or security * add switch to select format, lint or security * add switch to select format, lint or security
1 parent 2880814 commit 1eb4e7e

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/terraform.yaml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,21 @@ name: terraform-ci
22
on:
33
workflow_call:
44
inputs:
5+
enable_format:
6+
description: Run only format and validate
7+
type: boolean
8+
default: true
9+
required: false
10+
enable_lint:
11+
description: Run only linting
12+
type: boolean
13+
default: true
14+
required: false
15+
enable_security_check:
16+
description: Run only security checks
17+
type: boolean
18+
default: true
19+
required: false
520
upload_sarif:
621
description: Upload SARIF results to Github. Available in public repos, or private/internal repos for enterprises with Github Advanced Security.
722
type: boolean
@@ -98,7 +113,7 @@ env:
98113

99114
jobs:
100115
fmt-validate:
101-
if: github.ref_name != 'main'
116+
if: github.ref_name != 'main' && inputs.enable_format == true
102117
name: Format and Validate
103118
runs-on:
104119
- ${{ inputs.default_runner_override_label }}
@@ -197,7 +212,7 @@ jobs:
197212

198213
lint:
199214
name: Linting
200-
if: github.ref_name != 'main'
215+
if: github.ref_name != 'main' && inputs.enable_lint == true
201216
runs-on:
202217
- ${{ inputs.default_runner_override_label }}
203218
- ${{ inputs.runner_label }}
@@ -325,7 +340,7 @@ jobs:
325340
#steps.tflint.outcome check for outcome
326341
security:
327342
name: Security Checks
328-
if: github.ref_name != 'main'
343+
if: github.ref_name != 'main' && inputs.enable_security_check == true
329344
runs-on:
330345
- ${{ inputs.default_runner_override_label }}
331346
- ${{ inputs.runner_label }}

0 commit comments

Comments
 (0)