Skip to content

Commit d61e3fd

Browse files
committed
Fix shellcheck errors
Avoid trying to evaluate `github/codeql-action`.
1 parent e1ec697 commit d61e3fd

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,17 @@
33
# Typically, this will be main.
44

55
if [ -z "$GITHUB_TOKEN" ]; then
6-
echo "Failed: No GitHub token found. This script requires admin access to `github/codeql-action`."
6+
echo "Failed: No GitHub token found. This script requires admin access to github/codeql-action."
77
exit 1
88
fi
99

1010
if [ "$#" -eq 1 ]; then
11-
# If we were passed an argument, pass it as a query to fzf
12-
GITHUB_SHA="$@"
11+
# If we were passed an argument, use that as the SHA
12+
GITHUB_SHA="$0"
1313
elif [ "$#" -gt 1 ]; then
1414
echo "Usage: $0 [SHA]"
1515
echo "Update the required checks based on the SHA, or main."
16+
exit 1
1617
elif [ -z "$GITHUB_SHA" ]; then
1718
# If we don't have a SHA, use main
1819
GITHUB_SHA="$(git rev-parse main)"
@@ -21,7 +22,7 @@ fi
2122
echo "Getting checks for $GITHUB_SHA"
2223

2324
# Ignore any checks with "https://", CodeQL, LGTM, and Update checks.
24-
CHECKS="$(gh api repos/github/codeql-action/commits/${GITHUB_SHA}/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs | .[].name | select(contains("https://") or . == "CodeQL" or . == "LGTM.com" or contains("Update") or contains("update") | not)] | unique | sort')"
25+
CHECKS="$(gh api repos/github/codeql-action/commits/"${GITHUB_SHA}"/check-runs --paginate | jq --slurp --compact-output --raw-output '[.[].check_runs | .[].name | select(contains("https://") or . == ""CodeQL" or . == "LGTM.com" or contains("Update") or contains("update") | not)] | unique | sort')"
2526

2627
echo "$CHECKS" | jq
2728

0 commit comments

Comments
 (0)