From 0a5dad3c83b0f0549451307bb8d03f8e63109cf9 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 12 Jul 2022 17:33:24 +0100 Subject: [PATCH] Allow authenticating via the GitHub CLI We no longer run this script within Actions for security reasons, and when running locally we can authenticate with the GitHub CLI instead of a PAT. --- .github/workflows/script/update-required-checks.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/script/update-required-checks.sh b/.github/workflows/script/update-required-checks.sh index bc69be9931..1082347fe3 100755 --- a/.github/workflows/script/update-required-checks.sh +++ b/.github/workflows/script/update-required-checks.sh @@ -2,7 +2,8 @@ # Update the required checks based on the current branch. # Typically, this will be main. -if [ -z "$GITHUB_TOKEN" ]; then +if ! gh auth status 2>/dev/null; then + gh auth status echo "Failed: No GitHub token found. This script requires admin access to github/codeql-action." exit 1 fi