-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add rule for enforcing terrascan pre-commit hook #240
base: main
Are you sure you want to change the base?
add rule for enforcing terrascan pre-commit hook #240
Conversation
51ffe55
to
b720254
Compare
Co-authored-by: Giuseppe Scuglia <[email protected]>
b720254
to
4b29121
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar comments to #241
@@ -0,0 +1,19 @@ | |||
tests: | |||
- name: "Should have Talisman pre-commit hook configured" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: "Should have Talisman pre-commit hook configured" | |
- name: "Should have Terrascan pre-commit hook configured" |
expect: "pass" | ||
git: | ||
repo_base: correct | ||
- name: "Should fail Talisman pre-commit hook is not configured" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- name: "Should fail Talisman pre-commit hook is not configured" | |
- name: "Should fail Terrascan pre-commit hook is not configured" |
import future.keywords.if | ||
import future.keywords.every |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
import future.keywords.if | |
import future.keywords.every | |
import rego.v1 |
hooks[hook_id].id == "terraform-pre-commit" | ||
} | ||
|
||
message := "" if allow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
message := "" if allow | |
message := "Terrascan pre-commit hook is not configured for the repository" |
Co-authored-by: Giuseppe Scuglia [email protected]