GPT-5 finding
Assumes API responses are valid JSON; --argjson and jq parsing can fail, dropping result files and masking errors
mediumbuild-releasehigh
- scripts/postprocess-admanage-create.sh:95-97
- scripts/postprocess-admanage-create.sh:101-103
- scripts/postprocess-admanage-create.sh:119-121
- scripts/postprocess-admanage-create.sh:165-166
- scripts/postprocess-admanage-create.sh:167-169
- scripts/postprocess-admanage-create.sh:198-200
If curl returns a non-JSON response (e.g., HTML error page, 502 proxy), jq parsing fails. With pipefail but no `set -e`, variables become empty and --argjson consumes invalid JSON, causing jq to exit non-zero and produce no results file, reducing observability. Errors then get partially swallowed.
Recommendation
Validate response before jq parsing: if `jq -e . >/dev/null 2>&1` fails, treat resp as opaque text. Use `--arg resp "$resp"` (string) instead of `--argjson` when invalid. Always write a results file even when resp is non-JSON. Consider capturing HTTP status via `-w` and `--fail` in curl.