From 76bae626e2f22bb4d64f968c9ee3a5fb66fd8d73 Mon Sep 17 00:00:00 2001 From: Volkov Date: Sat, 10 Aug 2024 01:57:56 +0300 Subject: [PATCH] check: 1) for '-' in locals. 2) multiline 'for' output --- .github/workflows/terraform-validate.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/terraform-validate.yml b/.github/workflows/terraform-validate.yml index f2d36d9..beb2c45 100644 --- a/.github/workflows/terraform-validate.yml +++ b/.github/workflows/terraform-validate.yml @@ -38,7 +38,7 @@ jobs: - name: Check local value for network interface names run: | - if ! grep -q 'locals {' *.tf || ! grep -Eq '(nic_names|network_interface_names)' *.tf; then + if ! grep -q 'locals {' *.tf || ! grep -Eq '(nic-names|network_interface_names)' *.tf; then echo "Local value for network interface names not found!" exit 1 fi @@ -62,7 +62,7 @@ jobs: - name: Check local value for security rules run: | - if ! grep -q 'locals {' *.tf || ! grep -Eq '(security_rules|nsg_rules)' *.tf; then + if ! grep -q 'locals {' *.tf || ! grep -Eq '(security-rules|nsg_rules)' *.tf; then echo "Local value for security rules not found!" exit 1 fi @@ -70,7 +70,7 @@ jobs: - name: Check built-in functions usage run: | - if ! grep -q 'upper(' *.tf || ! grep -q 'join(' *.tf || ! grep -Eq '\[for.*:' *.tf; then + if ! grep -q 'upper(' *.tf || ! grep -q 'join(' *.tf || ! grep -Pzo '\[\s*.*for.*:' *.tf; then echo "Required built-in functions not used correctly!" exit 1 fi