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.
This commit is contained in:
Henry Mercer 2022-07-12 17:33:24 +01:00
parent d61e3fdf02
commit 0a5dad3c83

View file

@ -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