mirror of
https://github.com/PrismLauncher/PrismLauncher.git
synced 2025-05-28 21:00:20 +02:00
ci: ensure block pr scan always returns valid json
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
This commit is contained in:
parent
a2907dcaa3
commit
a6a172a136
30
.github/workflows/blocked_prs.yml
vendored
30
.github/workflows/blocked_prs.yml
vendored
@ -44,7 +44,7 @@ jobs:
|
|||||||
"prHeadSha": .head.sha,
|
"prHeadSha": .head.sha,
|
||||||
"prHeadLabel": .head.label,
|
"prHeadLabel": .head.label,
|
||||||
"prBody": .body,
|
"prBody": .body,
|
||||||
"prLabels": reduce .labels[].name as $l ([]; . + [$l])
|
"prLabels": (reduce .labels[].name as $l ([]; . + [$l]))
|
||||||
}
|
}
|
||||||
' <<< "$PR_JSON")"
|
' <<< "$PR_JSON")"
|
||||||
} >> "$GITHUB_ENV"
|
} >> "$GITHUB_ENV"
|
||||||
@ -80,7 +80,7 @@ jobs:
|
|||||||
"prHeadSha": .head.sha,
|
"prHeadSha": .head.sha,
|
||||||
"prHeadLabel": .head.label,
|
"prHeadLabel": .head.label,
|
||||||
"prBody": .body,
|
"prBody": .body,
|
||||||
"prLabels": reduce .labels[].name as $l ([]; . + [$l])
|
"prLabels": (reduce .labels[].name as $l ([]; . + [$l]))
|
||||||
}
|
}
|
||||||
' <<< "$PR_JSON")"
|
' <<< "$PR_JSON")"
|
||||||
} >> "$GITHUB_ENV"
|
} >> "$GITHUB_ENV"
|
||||||
@ -93,18 +93,24 @@ jobs:
|
|||||||
jq '
|
jq '
|
||||||
.prBody as $body
|
.prBody as $body
|
||||||
| (
|
| (
|
||||||
$body | scan("blocked (?(?by)|(?on)):? #(?<num>[0-9]+)")
|
$body |
|
||||||
| map({
|
reduce (
|
||||||
"type": "Blocked on",
|
. | scan("blocked (?:by|on):? #([0-9]+)")
|
||||||
"number": ( . | tonumber )
|
| map({
|
||||||
})
|
"type": "Blocked on",
|
||||||
|
"number": ( . | tonumber )
|
||||||
|
})
|
||||||
|
) as $i ([]; . + [$i])
|
||||||
) as $bprs
|
) as $bprs
|
||||||
| (
|
| (
|
||||||
$body | scan("stacked on:? #(?<num>[0-9]+)")
|
$body |
|
||||||
| map({
|
reduce (
|
||||||
"type": "Stacked on",
|
. | scan("stacked on:? #([0-9]+)")
|
||||||
"number": ( . | tonumber )
|
| map({
|
||||||
})
|
"type": "Stacked on",
|
||||||
|
"number": ( . | tonumber )
|
||||||
|
})
|
||||||
|
) as $i ([]; . + [$i])
|
||||||
) as $sprs
|
) as $sprs
|
||||||
| ($bprs + $sprs) as $prs
|
| ($bprs + $sprs) as $prs
|
||||||
| {
|
| {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user