From 2940034fda94fa2edff77864999d2993283533b4 Mon Sep 17 00:00:00 2001 From: ptiurin Date: Mon, 19 Aug 2024 18:04:21 +0100 Subject: [PATCH] better way --- .github/replace.pl | 27 ---------------------- .github/workflows/integration-tests-v2.yml | 4 ++-- 2 files changed, 2 insertions(+), 29 deletions(-) delete mode 100644 .github/replace.pl diff --git a/.github/replace.pl b/.github/replace.pl deleted file mode 100644 index 03b1e1d1..00000000 --- a/.github/replace.pl +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/perl -# Replace a specific string in a file with a placeholder value -# work with any string, including special characters - -use strict; -use warnings; - -# Check if both arguments are provided -if (@ARGV != 2) { - die "Usage: perl replace_string.pl \n"; -} - -my $string_to_replace = $ARGV[0]; -my $file = $ARGV[1]; - -# Read the file content -open(my $fh, '<', $file) or die "Could not open file '$file' $!"; -my $content = do { local $/; <$fh> }; -close($fh); - -# Replace the string -$content =~ s/\Q$string_to_replace\E/REDACTED/g; - -# Write the updated content back to the file -open($fh, '>', $file) or die "Could not open file '$file' $!"; -print $fh $content; -close($fh); diff --git a/.github/workflows/integration-tests-v2.yml b/.github/workflows/integration-tests-v2.yml index 3703b97e..f3cbc8fc 100644 --- a/.github/workflows/integration-tests-v2.yml +++ b/.github/workflows/integration-tests-v2.yml @@ -56,8 +56,8 @@ jobs: - name: Make sure no secrets make it to the logs run: | - find allure-results -type f -exec perl .github/replace.pl ${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }} {} + - find allure-results -type f -exec perl .github/replace.pl ${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }} {} + + find allure-results -type f -exec sed -i 's/${{ secrets.FIREBOLT_CLIENT_ID_STG_NEW_IDN }}/REDACTED/g' {} + + find allure-results -type f -exec sed -i 's/${{ secrets.FIREBOLT_CLIENT_SECRET_STG_NEW_IDN }}/REDACTED/g' {} + - name: Save failed tests id: cache-tests-save