From 5f6cd3ed77222efd793ef677d83b88b616bc4b78 Mon Sep 17 00:00:00 2001 From: PikachuEXE Date: Tue, 2 Apr 2024 16:18:59 +0800 Subject: [PATCH] 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/ --- Library/Homebrew/utils/github/api.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index e9848bca817be..f783fbab93161 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -27,7 +27,7 @@ def self.pat_blurb(scopes = ALL_SCOPES) 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. #