Skip to content

Commit

Permalink
Merge pull request #458 from ministryofjustice/issue13
Browse files Browse the repository at this point in the history
Adds redact output script to unit test workflow.
  • Loading branch information
mikereiddigital authored Jul 1, 2024
2 parents 31310a7 + f6f3840 commit f98c1e0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion .github/workflows/go-terratest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ jobs:
run: go mod download
- name: Run Go Tests
working-directory: test
run: go test -v
run: |
chmod 700 ../scripts/redact-output.sh
go test -v | ../scripts/redact-output.sh
11 changes: 11 additions & 0 deletions scripts/redact-output.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

# Based on: https://github.com/ministryofjustice/opg-org-infra/blob/main/scripts/redact_output.sh

sed -e 's/AWS_SECRET_ACCESS_KEY".*/<REDACTED>/g' \
-e 's/AWS_ACCESS_KEY_ID".*/<REDACTED>/g' \
-e 's/$AWS_SECRET_ACCESS_KEY".*/<REDACTED>/g' \
-e 's/$AWS_ACCESS_KEY_ID".*/<REDACTED>/g' \
-e 's/\[id=.*\]/\[id=<REDACTED>\]/g' \
-e 's/::[0-9]\{12\}:/::REDACTED:/g' \
-e 's/:[0-9]\{12\}:/:REDACTED:/g'

0 comments on commit f98c1e0

Please sign in to comment.