Commit bad849d
committed
Fix 404 response body breaking tag existence check
gh api prints the 404 JSON response body to stdout even on failure.
The previous command $(gh api ... 2>/dev/null || echo "") only
suppressed stderr and prevented exit code propagation, but the 404
body was still captured into EXISTING_JSON, making the -n test pass
and causing node to throw a TypeError on .object.sha.
Split the assignment from the fallback so that on non-zero exit,
EXISTING_JSON is explicitly overwritten to empty string.1 parent 7e12956 commit bad849d
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
0 commit comments