bump-formula-pr: return remote url with token in it

This commit is contained in:
Dawid Dziurla 2020-02-29 01:19:16 +01:00
parent f37cd18e1a
commit 456f3b1923
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B

View File

@ -420,7 +420,9 @@ module Homebrew
remote_url = if system("git", "config", "--local", "--get-regexp", "remote\..*\.url", "git@github.com:.*")
response.fetch("ssh_url")
else
response.fetch("clone_url")
url = response.fetch("clone_url")
url.gsub!(%r{^https://github\.com/}, "https://#{GitHub.env_token}@github.com/") if GitHub.env_token
url
end
username = response.fetch("owner").fetch("login")
[remote_url, username]