Skip to content

Commit 411061f

Browse files
fix(ci): use jq for dev-release check-run filter (#1230)
1 parent d3affdc commit 411061f

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

.github/workflows/dev-release.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,13 +117,20 @@ jobs:
117117
current_suite_id=$(gh api "repos/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" \
118118
--jq '.check_suite_id' 2>/dev/null || echo "0")
119119
120+
# gh api's built-in --jq does not support jq variables like --arg, so
121+
# use jq directly for the suite-id filter.
120122
conclusions=$(gh api "repos/${GITHUB_REPOSITORY}/commits/${head_sha}/check-runs" \
121123
--paginate \
122-
--arg suite "$current_suite_id" \
123-
--jq '[.check_runs[] | select(
124-
.app.slug == "github-actions" and
125-
((.check_suite.id | tostring) != $suite)
126-
)] | map(.conclusion) | unique | .[]' 2>/dev/null || echo unknown)
124+
--slurp 2>/dev/null | jq -r --arg suite "$current_suite_id" '
125+
[.[].check_runs[]?
126+
| select(
127+
.app.slug == "github-actions" and
128+
((.check_suite.id | tostring) != $suite)
129+
)
130+
| .conclusion]
131+
| unique
132+
| .[]
133+
' 2>/dev/null || echo unknown)
127134
128135
echo "CI conclusions: $conclusions"
129136

0 commit comments

Comments
 (0)