We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2b07444 + 33da5f0 commit b8806ecCopy full SHA for b8806ec
.github/workflows/script/update-required-checks.sh
@@ -1,6 +1,8 @@
1
#!/usr/bin/env bash
2
# Update the required checks based on the current branch.
3
4
+set -euo pipefail
5
+
6
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
7
REPO_DIR="$(dirname "$SCRIPT_DIR")"
8
GRANDPARENT_DIR="$(dirname "$REPO_DIR")"
@@ -31,6 +33,12 @@ CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs -
31
33
32
34
echo "$CHECKS" | jq
35
36
+# Fail if there are no checks
37
+if [ -z "$CHECKS" ] || [ "$(echo "$CHECKS" | jq '. | length')" -eq 0 ]; then
38
+ echo "No checks found for $GITHUB_SHA"
39
+ exit 1
40
+fi
41
42
echo "{\"contexts\": ${CHECKS}}" > checks.json
43
44
echo "Updating main"
0 commit comments