Skip to content

Commit

Permalink
Merge pull request #99 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 7b2ad31 + 0867059 commit e93621d
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 e93621d

Please sign in to comment.