From 90c02f7b5a213613e656e89583ac687aa145f1e3 Mon Sep 17 00:00:00 2001 From: hyuraku <32809703+hyuraku@users.noreply.github.com> Date: Wed, 2 Jun 2021 21:13:53 +0900 Subject: [PATCH] change https://api.github.com to API_URL --- Library/Homebrew/utils/github.rb | 4 ++-- Library/Homebrew/utils/github/api.rb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index b9429f43d2..341a7520b9 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -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 diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index f0f0b85f18..b92d53d715 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -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|