Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/action-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ jobs:
set -uo pipefail
mkdir -p _fx
printf 'AWS_ACCESS_KEY_ID=%s%s\n' 'AKIA' 'IOSFODNN7EXAMPLE' > _fx/leak.env
out="$("${RUNNER_TEMP}/leakwatch" scan fs _fx --format github --no-verify 2>/dev/null)"
# leakwatch exits 1 on findings; `|| true` so the capture doesn't abort
# the step under bash -e (GitHub's default shell flags).
out="$("${RUNNER_TEMP}/leakwatch" scan fs _fx --format github --no-verify 2>/dev/null || true)"
echo "$out"
echo "$out" | grep -q '^::error .*aws-access-key-id' \
|| { echo "::error::expected an ::error annotation for aws-access-key-id"; exit 1; }
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,10 @@ runs:
# Do NOT echo the assembled args: path/extra-args may carry credentials
# (tokens, authenticated URLs) that GitHub log masking would not catch.
echo "Running leakwatch scan (type=${INPUT_SCAN_TYPE}, format=${INPUT_FORMAT})"
# GitHub invokes bash with -e; findings legitimately exit 1, so disable
# errexit around the scan and map the exit code ourselves below (otherwise
# the step would abort here and fail-on-findings: false would be ignored).
set +e
leakwatch "${ARGS[@]}"
EXIT_CODE=$?
Comment thread
sourcery-ai[bot] marked this conversation as resolved.

Expand Down
Loading