Merge pull request #11480 from hyuraku/use_const_API_URL
change https://api.github.com to API_URL
This commit is contained in:
commit
995baa96e2
@ -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
|
||||
|
@ -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|
|
||||
|
Loading…
x
Reference in New Issue
Block a user