diff --git a/Library/Homebrew/dev-cmd/bump-formula-pr.rb b/Library/Homebrew/dev-cmd/bump-formula-pr.rb index 7660a938e9..1eac5573d3 100644 --- a/Library/Homebrew/dev-cmd/bump-formula-pr.rb +++ b/Library/Homebrew/dev-cmd/bump-formula-pr.rb @@ -427,7 +427,9 @@ module Homebrew response.fetch("ssh_url") else url = response.fetch("clone_url") - url.gsub!(%r{^https://github\.com/}, "https://#{GitHub.env_token}@github.com/") if GitHub.env_token + if (api_token = Homebrew::EnvConfig.github_api_token) + url.gsub!(%r{^https://github\.com/}, "https://#{api_token}@github.com/") + end url end username = response.fetch("owner").fetch("login")