This commit is contained in:
hyuraku 2021-06-02 21:13:53 +09:00
parent f9dd12ef5c
commit 90c02f7b5a
2 changed files with 3 additions and 3 deletions

View File

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

View File

@ -255,7 +255,7 @@ module GitHub
def open_graphql(query, scopes: [].freeze) def open_graphql(query, scopes: [].freeze)
data = { query: query } 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? if result["errors"].present?
raise Error, result["errors"].map { |e| raise Error, result["errors"].map { |e|