File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments