From e2f8dcf94955216af0e86e0e689663b3b6258a0d Mon Sep 17 00:00:00 2001 From: Joshua Donovan Date: Wed, 18 Sep 2024 10:22:15 -0500 Subject: [PATCH 1/5] Add file name trim to script loop --- ...nfirm-policy-definition-no-built-in-conflicts.yaml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml index d42ef60c..a02d4a5c 100644 --- a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml +++ b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml @@ -39,8 +39,15 @@ jobs: echo " Info: changed files converted to array, ready to check each file..." - for file in "${files[@]}"; do - echo " Checking file name: ${file}" + for rawfile in "${files[@]}"; do + echo " Checking file name: ${rawfile}" + + # Trim backspaces from the file name + file=$(echo $rawfile | tr -d '\\') + + echo " Trimmed file name: ${file}" + echo "" + if echo "$file" | grep -q 'github/workflows'; then echo ' \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/////////////////////////////////' echo ' | |' From df86a63a84a1194b7cb904a9710a8db28e2618f3 Mon Sep 17 00:00:00 2001 From: Joshua Donovan Date: Wed, 18 Sep 2024 10:45:20 -0500 Subject: [PATCH 2/5] update for testing --- .../confirm-policy-definition-no-built-in-conflicts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml index a02d4a5c..06727790 100644 --- a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml +++ b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml @@ -3,7 +3,7 @@ name: Confirm Policy Definition has Unique ID and does not conflict with Built-I on: pull_request: branches: - - main + - GUID-Validation jobs: # ------------------------------------------------------------- From 4007b3a35f36bc5ea5ce7718742055fdffb3e42f Mon Sep 17 00:00:00 2001 From: Joshua Donovan Date: Wed, 18 Sep 2024 10:54:09 -0500 Subject: [PATCH 3/5] Test-Logic --- .../confirm-policy-definition-no-built-in-conflicts.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml index 06727790..88a1476b 100644 --- a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml +++ b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml @@ -41,7 +41,11 @@ jobs: for rawfile in "${files[@]}"; do echo " Checking file name: ${rawfile}" - + + echo " For Testing only, appending \\ to the file name" + rawfile="${rawfile\\}" + echo " Pre-Trim Validation file name: ${rawfile}" + # Trim backspaces from the file name file=$(echo $rawfile | tr -d '\\') From 2aa8c737c51b23404b6f270ade0333c3b85852c3 Mon Sep 17 00:00:00 2001 From: Joshua Donovan Date: Wed, 18 Sep 2024 10:55:33 -0500 Subject: [PATCH 4/5] fix test --- .../confirm-policy-definition-no-built-in-conflicts.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml index 88a1476b..163481c9 100644 --- a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml +++ b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml @@ -43,7 +43,7 @@ jobs: echo " Checking file name: ${rawfile}" echo " For Testing only, appending \\ to the file name" - rawfile="${rawfile\\}" + rawfile="${rawfile}\\" echo " Pre-Trim Validation file name: ${rawfile}" # Trim backspaces from the file name From e1a14382cc21de7f2202eb8ef3183011f1593562 Mon Sep 17 00:00:00 2001 From: Joshua Donovan Date: Wed, 18 Sep 2024 10:57:09 -0500 Subject: [PATCH 5/5] Removing Test Code --- .../confirm-policy-definition-no-built-in-conflicts.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml index 163481c9..47831b94 100644 --- a/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml +++ b/.github/workflows/confirm-policy-definition-no-built-in-conflicts.yaml @@ -3,7 +3,7 @@ name: Confirm Policy Definition has Unique ID and does not conflict with Built-I on: pull_request: branches: - - GUID-Validation + - main jobs: # ------------------------------------------------------------- @@ -42,10 +42,6 @@ jobs: for rawfile in "${files[@]}"; do echo " Checking file name: ${rawfile}" - echo " For Testing only, appending \\ to the file name" - rawfile="${rawfile}\\" - echo " Pre-Trim Validation file name: ${rawfile}" - # Trim backspaces from the file name file=$(echo $rawfile | tr -d '\\')