Merge pull request #7092 from dawidd6/bump-push-with-token

bump-formula-pr: return remote url with token in it
This commit is contained in:
Mike McQuaid 2020-03-02 18:42:57 +00:00 committed by GitHub
commit 10ba0d5a66
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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]