You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As reported in Slack, if a value is missing, `jq` returns `null`.
When run normally (e.g., `echo "${JOB}" | jq -r '.somekey'`), this becomes an empty string when the key is missing.
However, when run within a subshell (e.g., when assigning to a variable, such as `VALUE=$(echo "${JOB}" | jq -r '.somekey')`), the string `null` is returned.
Fortunately, `jq` allows specifying an alternative value if a value is missing or `false` or `null`, via the `//` operator.
This patch adds alternatives everywhere `jq` is invoked when assigning a variable.
Signed-off-by: Matthew Weier O'Phinney <[email protected]>
0 commit comments