-
Notifications
You must be signed in to change notification settings - Fork 158
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix the way we target linting at specific path (#4118)
* Fix the way we target linting at specific path * split out core tag validation --------- Co-authored-by: Tamir Kamara <[email protected]> Co-authored-by: Tim Allen <[email protected]>
- Loading branch information
1 parent
d259370
commit f91bdd1
Showing
3 changed files
with
37 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# This is used for TRE tags validation only. | ||
|
||
config { | ||
module = true | ||
force = false | ||
} | ||
|
||
plugin "azurerm" { | ||
enabled = true | ||
} | ||
|
||
rule "terraform_typed_variables" { | ||
enabled = false | ||
} | ||
|
||
rule "azurerm_resource_missing_tags" { | ||
enabled = true | ||
tags = ["tre_id"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,9 @@ jobs: | |
docs: | ||
- 'docs/**/*' | ||
terraform_core: | ||
- core/**/terraform/**/*.tf | ||
terraform_workspaces: | ||
- templates/workspaces/**/terraform/**/*.tf | ||
|
@@ -95,6 +98,17 @@ jobs: | |
pip install -r docs/requirements.txt | ||
mkdocs build --strict | ||
- name: Core Tags | ||
if: ${{ steps.filter.outputs.terraform_core == 'true' }} | ||
uses: github/super-linter/[email protected] | ||
env: | ||
VALIDATE_ALL_CODEBASE: false | ||
DEFAULT_BRANCH: main | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VALIDATE_TERRAFORM_TFLINT: true | ||
TERRAFORM_TFLINT_CONFIG_FILE: .tflint_core.hcl | ||
FILTER_REGEX_INCLUDE: './core/.*' | ||
|
||
- name: Workspace Tags | ||
if: ${{ steps.filter.outputs.terraform_workspaces == 'true' }} | ||
uses: github/super-linter/[email protected] | ||
|
@@ -104,7 +118,7 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VALIDATE_TERRAFORM_TFLINT: true | ||
TERRAFORM_TFLINT_CONFIG_FILE: .tflint_workspaces.hcl | ||
LINTER_REGEX_INCLUDE: './templates/workspaces/.*' | ||
FILTER_REGEX_INCLUDE: './templates/workspaces/.*' | ||
|
||
- name: Workspace Services Tags | ||
if: ${{ steps.filter.outputs.terraform_workspace_services == 'true' }} | ||
|
@@ -115,7 +129,7 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VALIDATE_TERRAFORM_TFLINT: true | ||
TERRAFORM_TFLINT_CONFIG_FILE: .tflint_workspace_services.hcl | ||
LINTER_REGEX_INCLUDE: './templates/workspaces/.*' | ||
FILTER_REGEX_INCLUDE: './templates/workspaces/.*' | ||
FILTER_REGEX_EXCLUDE: '.*user_resource.*' | ||
|
||
- name: User Resources Tags | ||
|
@@ -127,7 +141,7 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VALIDATE_TERRAFORM_TFLINT: true | ||
TERRAFORM_TFLINT_CONFIG_FILE: .tflint_user_resources.hcl | ||
LINTER_REGEX_INCLUDE: './templates/workspace_services/.*/user_resources/.*' | ||
FILTER_REGEX_INCLUDE: './templates/workspace_services/.*/user_resources/.*' | ||
|
||
- name: Shared Services Tags | ||
if: ${{ steps.filter.outputs.terraform_shared_services == 'true' }} | ||
|
@@ -138,4 +152,4 @@ jobs: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VALIDATE_TERRAFORM_TFLINT: true | ||
TERRAFORM_TFLINT_CONFIG_FILE: .tflint_shared_services.hcl | ||
LINTER_REGEX_INCLUDE: './templates/shared_services/.*' | ||
FILTER_REGEX_INCLUDE: './templates/shared_services/.*' |