diff --git a/build-locally.sh b/build-locally.sh index c2508401d..cf17b643a 100755 --- a/build-locally.sh +++ b/build-locally.sh @@ -220,8 +220,19 @@ function check_secrets { error "Not all secrets found have been audited" exit 1 fi - sed -i '' '/[ ]*"generated_at": ".*",/d' .secrets.baseline success "secrets audit complete" + + h2 "Removing the timestamp from the secrets baseline file so it doesn't always cause a git change." + mkdir -p temp + rc=$? + check_exit_code $rc "Failed to create a temporary folder" + cat .secrets.baseline | grep -v "generated_at" > temp/.secrets.baseline.temp + rc=$? + check_exit_code $rc "Failed to create a temporary file with no timestamp inside" + mv temp/.secrets.baseline.temp .secrets.baseline + rc=$? + check_exit_code $rc "Failed to overwrite the secrets baseline with one containing no timestamp inside." + success "secrets baseline timestamp content has been removed ok" } function update_release_yaml {