fix: feed curl auth config on stdin (no process substitution on Git Bash)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
sysadminandClaude Sonnet 5.5 committed 2026-10-21 15:30:09 +01:00
1 parent 99fbbce4b4
commit 10c272efa2
2 files changed
+25 -4

No files matched your search

+5 -4
View File
@@ -150,12 +150,13 @@ fi
[ -n "${CATALOGUE_PUBLISH_KEY:-}" ] || die "CATALOGUE_PUBLISH_KEY is not set"
# Pass the bearer header through a curl config read from a process
# substitution, so the key never lands in argv or the shell trace.
# Pass the bearer header through a curl config on stdin (-K -), so the key never
# lands in argv or the shell trace. (Not process substitution: native Windows
# curl under Git Bash cannot open /dev/fd paths.)
BODY_FILE="$(mktemp)"
trap 'rm -f "$BODY_FILE"' EXIT
HTTP_CODE="$(curl -sS -o "$BODY_FILE" -w '%{http_code}' -X POST \
-K <(printf 'header = "Authorization: Bearer %s"\n' "$CATALOGUE_PUBLISH_KEY") \
HTTP_CODE="$(printf 'header = "Authorization: Bearer %s"\n' "$CATALOGUE_PUBLISH_KEY" |
curl -sS -o "$BODY_FILE" -w '%{http_code}' -X POST -K - \
"${FIELDS[@]}" "$URL")" || die "request to $URL failed"
BODY="$(cat "$BODY_FILE")"