Skip to content

Commit 33da5f0

Browse files
henrymercerCopilot
andauthored
Use jq to check array length
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8a9ef89 commit 33da5f0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

.github/workflows/script/update-required-checks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs -
3434
echo "$CHECKS" | jq
3535

3636
# Fail if there are no checks
37-
if [ -z "$CHECKS" ] || [ "$CHECKS" == "[]" ]; then
37+
if [ -z "$CHECKS" ] || [ "$(echo "$CHECKS" | jq '. | length')" -eq 0 ]; then
3838
echo "No checks found for $GITHUB_SHA"
3939
exit 1
4040
fi

0 commit comments

Comments
 (0)