From ca85c5355f665104e96232ba2e5c90e56a503e5c Mon Sep 17 00:00:00 2001 From: Sohan Honavar Date: Sat, 10 Feb 2024 03:50:08 +0530 Subject: [PATCH] Reused the variable as per the review suggestion --- Library/Homebrew/utils/github/api.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index f058762c19..c6b0e8ebe9 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -197,6 +197,8 @@ module GitHub scopes = response_headers["x-accepted-oauth-scopes"].to_s.split(", ") needed_scopes = Set.new(scopes || needed_scopes) + github_permission_link = GitHub.pat_blurb(needed_scopes) + credentials_scopes = response_headers["x-oauth-scopes"] return if needed_scopes.subset?(Set.new(credentials_scopes.to_s.split(", "))) @@ -208,7 +210,7 @@ module GitHub Your #{what} credentials do not have sufficient scope! Scopes required: #{needed_scopes} Scopes present: #{credentials_scopes} - #{GitHub.pat_blurb(needed_scopes.split(", "))} + #{github_permission_link} EOS end