make more token types work as $HOMEBREW_GITHUB_API_TOKEN

Tokens of different token type(s) can be generated in GitHub Workflows by GitHub Apps

See doc & blog about token types
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/about-authentication-to-github#githubs-token-formats
https://github.blog/2021-04-05-behind-githubs-new-authentication-token-formats/
This commit is contained in:
PikachuEXE 2024-04-02 16:18:59 +08:00 committed by GitHub
parent 0b98c50866
commit 5f6cd3ed77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -27,7 +27,7 @@ module GitHub
CREATE_ISSUE_FORK_OR_PR_SCOPES = ["repo"].freeze
CREATE_WORKFLOW_SCOPES = ["workflow"].freeze
ALL_SCOPES = (CREATE_GIST_SCOPES + CREATE_ISSUE_FORK_OR_PR_SCOPES + CREATE_WORKFLOW_SCOPES).freeze
GITHUB_PERSONAL_ACCESS_TOKEN_REGEX = /^(?:[a-f0-9]{40}|(?:gh[po]|github_pat)_\w{36,251})$/
GITHUB_PERSONAL_ACCESS_TOKEN_REGEX = /^(?:[a-f0-9]{40}|(?:gh[pousr]|github_pat)_\w{36,251})$/
# Helper functions to access the GitHub API.
#