Merge pull request #11480 from hyuraku/use_const_API_URL

change https://api.github.com to API_URL
This commit is contained in:
Mike McQuaid 2021-06-02 13:40:30 +01:00 committed by GitHub
commit 995baa96e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -37,13 +37,13 @@ module GitHub
end
def create_gist(files, description, private:)
url = "https://api.github.com/gists"
url = "#{API_URL}/gists"
data = { "public" => !private, "files" => files, "description" => description }
API.open_rest(url, data: data, scopes: CREATE_GIST_SCOPES)["html_url"]
end
def create_issue(repo, title, body)
url = "https://api.github.com/repos/#{repo}/issues"
url = "#{API_URL}/repos/#{repo}/issues"
data = { "title" => title, "body" => body }
API.open_rest(url, data: data, scopes: CREATE_ISSUE_FORK_OR_PR_SCOPES)["html_url"]
end

View File

@ -255,7 +255,7 @@ module GitHub
def open_graphql(query, scopes: [].freeze)
data = { query: query }
result = open_rest("https://api.github.com/graphql", scopes: scopes, data: data, request_method: "POST")
result = open_rest("#{API_URL}/graphql", scopes: scopes, data: data, request_method: "POST")
if result["errors"].present?
raise Error, result["errors"].map { |e|