Skip to content

Commit 2beac9f

Browse files
committed
fix(ci): harden OIDC error redaction to cover all token fields
1 parent 4f058b3 commit 2beac9f

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.github/actions/artifactory-oidc/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ runs:
6262
6363
if [ -z "$ART_TOKEN" ]; then
6464
echo "::error::OIDC token exchange failed."
65-
echo "$RESP" | jq 'if .access_token then .access_token="<redacted>" else . end' 2>/dev/null || echo "$RESP"
65+
echo "$RESP" | jq 'walk(if type == "object" then with_entries(if (.key | test("token"; "i")) then .value = "<redacted>" else . end) else . end)' 2>/dev/null \
66+
|| echo "::error::(response withheld — not valid JSON)"
6667
exit 1
6768
fi
6869
echo "::add-mask::$ART_TOKEN"

0 commit comments

Comments
 (0)