mirror of
https://gitea.com/gitea/docs.git
synced 2026-09-20 04:58:52 +00:00
ci: keep the jq expressions parsable on jq 1.6
This commit is contained in:
@@ -26,7 +26,9 @@ if [ -z "$PULL_JSON" ] || [ ! -f "$PULL_JSON" ]; then
|
||||
fi
|
||||
|
||||
body="$(jq -r '.body // ""' "$PULL_JSON")"
|
||||
labelled="$(jq -r --arg label "$LABEL" '[.labels[]?.name] | index($label) != null' "$PULL_JSON")"
|
||||
# `label` is a keyword in jq 1.6, which is what the runner image has, so the
|
||||
# argument cannot be named after it; `(.labels // [])` keeps it parsable there
|
||||
labelled="$(jq -r --arg want "$LABEL" '[(.labels // [])[].name] | index($want) != null' "$PULL_JSON")"
|
||||
|
||||
# every gitea#<id> and every pull request url, deduplicated
|
||||
refs="$(printf '%s\n' "$body" \
|
||||
|
||||
Reference in New Issue
Block a user