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
14
.github/workflows/blocked_prs.yml
vendored
14
.github/workflows/blocked_prs.yml
vendored
@ -44,7 +44,7 @@ jobs:
|
||||
"prHeadSha": .head.sha,
|
||||
"prHeadLabel": .head.label,
|
||||
"prBody": .body,
|
||||
"prLabels": reduce .labels[].name as $l ([]; . + [$l])
|
||||
"prLabels": (reduce .labels[].name as $l ([]; . + [$l]))
|
||||
}
|
||||
' <<< "$PR_JSON")"
|
||||
} >> "$GITHUB_ENV"
|
||||
@ -80,7 +80,7 @@ jobs:
|
||||
"prHeadSha": .head.sha,
|
||||
"prHeadLabel": .head.label,
|
||||
"prBody": .body,
|
||||
"prLabels": reduce .labels[].name as $l ([]; . + [$l])
|
||||
"prLabels": (reduce .labels[].name as $l ([]; . + [$l]))
|
||||
}
|
||||
' <<< "$PR_JSON")"
|
||||
} >> "$GITHUB_ENV"
|
||||
@ -93,18 +93,24 @@ jobs:
|
||||
jq '
|
||||
.prBody as $body
|
||||
| (
|
||||
$body | scan("blocked (?(?by)|(?on)):? #(?<num>[0-9]+)")
|
||||
$body |
|
||||
reduce (
|
||||
. | scan("blocked (?:by|on):? #([0-9]+)")
|
||||
| map({
|
||||
"type": "Blocked on",
|
||||
"number": ( . | tonumber )
|
||||
})
|
||||
) as $i ([]; . + [$i])
|
||||
) as $bprs
|
||||
| (
|
||||
$body | scan("stacked on:? #(?<num>[0-9]+)")
|
||||
$body |
|
||||
reduce (
|
||||
. | scan("stacked on:? #([0-9]+)")
|
||||
| map({
|
||||
"type": "Stacked on",
|
||||
"number": ( . | tonumber )
|
||||
})
|
||||
) as $i ([]; . + [$i])
|
||||
) as $sprs
|
||||
| ($bprs + $sprs) as $prs
|
||||
| {
|
||||
|
Loading…
x
Reference in New Issue
Block a user