From 547f01408a1a63eececcc7c867c0f371e16f8076 Mon Sep 17 00:00:00 2001 From: Sara Aspery Date: Thu, 19 Dec 2024 16:53:04 +0000 Subject: [PATCH] ACS-9044 fix for temporary directory --- .github/workflows/ci.yml | 6 +++--- scripts/ci/remove-sast-exclusions.sh | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 93ead13426..faae55810b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,8 +85,8 @@ jobs: bash ./scripts/ci/build.sh - name: "Remove excluded files" run: | - bash mkdir temp-dir-for-sast - bash ./scripts/ci/remove-sast-exclusions.sh ./distribution/target/alfresco-reduced.war ./temp-dir-for-sast/reduced.war + mkdir temp-dir-for-sast + bash ./scripts/ci/remove-sast-exclusions.sh ./distribution/target/alfresco-reduced.war temp-dir-for-sast/reduced.war - name: "Run SAST Scan" uses: veracode/Veracode-pipeline-scan-action@v1.0.16 with: @@ -111,7 +111,7 @@ jobs: name: Veracode Pipeline-Scan Results - ACS (Human Readable) path: readable_output.zip - name: "Remove temporary directory" - run: bash rm -rfv temp-dir-for-sast + run: rm -rfv temp-dir-for-sast - name: "Clean Maven cache" run: bash ./scripts/ci/cleanup_cache.sh diff --git a/scripts/ci/remove-sast-exclusions.sh b/scripts/ci/remove-sast-exclusions.sh index d788aa02a3..8826cb2aa1 100755 --- a/scripts/ci/remove-sast-exclusions.sh +++ b/scripts/ci/remove-sast-exclusions.sh @@ -4,7 +4,7 @@ set -ex pushd "$(dirname "${BASH_SOURCE[0]}")/../../" # Copy war file to temporary directory -cp -f "$1" ./temp-dir-for-sast/reduced.war +cp -f "$1" "$2" # Remove files to be excluded from Veracode SAST exclusions="./scripts/ci/SAST-exclusion-list.txt" @@ -13,7 +13,7 @@ then while read -r line do echo "Removing WEB-INF/lib/$line" - zip -d ./temp-dir-for-sast/reduced.war "WEB-INF/lib/$line" || true + zip -d "$2" "WEB-INF/lib/$line" || true done < "$exclusions" else echo "No files to be excluded from SAST"