b0VIM 8.1*"_Ra_joshJoshs-Mac-mini.local~josh/Projects/fastlane/fastlane/fastlane/lib/fastlane/actions/github_api.rb 3210#"! UtpY2Z`&ad)Y_6.- 0 Q . - k V 5   Y ;   m \ > e Ao10i0A FastlaneCore::ConfigItem.new(key: :api_token, end), UI.user_error!("Please include the protocol in the server url, e.g. https://your.github.server/api/v3") unless value.include?("//") verify_block: proc do |value| optional: true, default_value: "https://api.github.com", description: "The server url. e.g. 'https://your.internal.github.host/api/v3' (Default: 'https://api.github.com')", env_name: "FL_GITHUB_API_SERVER_URL", FastlaneCore::ConfigItem.new(key: :server_url, [ def available_options end ].join("\n") "Documentation: [https://developer.github.com/v3](https://developer.github.com/v3)." "Out parameters provide the status code and the full response JSON if valid, otherwise the raw response body.", "Calls any GitHub API endpoint. You must provide your GitHub Personal token (get one from [https://github.com/settings/tokens/new](https://github.com/settings/tokens/new)).", [ def details end "Call a GitHub API endpoint and get the resulting JSON response" def description ##################################################### # @!group Documentation ##################################################### end return result Actions.lane_context[SharedValues::GITHUB_API_JSON] = result[:json] Actions.lane_context[SharedValues::GITHUB_API_RESPONSE] = result[:body] Actions.lane_context[SharedValues::GITHUB_API_STATUS_CODE] = result[:status] end end UI.user_error!("GitHub responded with #{status_code}\n---\n#{response.body}") UI.error(response.body) UI.error("Response:") UI.error("---") UI.error("Headers:\n#{headers}") UI.error("Request failed:\n#{http_method}: #{url}") UI.error("---") else handled_error.call(result) if handled_error handled_error = error_handlers[status_code] || error_handlers['*'] else yield(result) if block_given? UI.verbose("---") UI.verbose(response.body) UI.verbose("Response:") if status_code.between?(200, 299) } json: parse_json(response.body) || {} body: response.body || "", status: status_code, result = { status_code = response[:status] ) secure payload, headers, http_method, url, response = call_endpoint( secure = params[:secure] error_handlers = params[:error_handlers] || {} payload = construct_body(params[:body], params[:raw_body]) headers = construct_headers(params[:api_token], params[:api_bearer], params[:headers]) url = construct_url(params[:server_url], params[:path], params[:url]) http_method = (params[:http_method] || 'GET').to_s.upcase require 'json' def run(params) class << self class GithubApiAction < Action end GITHUB_API_JSON = :GITHUB_API_JSON GITHUB_API_RESPONSE = :GITHUB_API_RESPONSE GITHUB_API_STATUS_CODE = :GITHUB_API_STATUS_CODE module SharedValues module Actionsmodule Fastlanead &v vji&   Q P  v ^ # end end end end end ) debug_response: FastlaneCore::Globals.verbose? debug_request: FastlaneCore::Globals.verbose?, body: body, middlewares: middlewares, headers: headers, method: http_method, connection.request( connection = Excon.new(url) UI.verbose("#{http_method} : #{url}") middlewares = Excon.defaults[:middlewares] + [Excon::Middleware::RedirectFollower] # allow redirect in case of repo renames Excon.defaults[:ssl_verify_peer] = secure require 'excon' def call_endpoint(url, http_method, headers, body, secure) end nil rescue JSON::ParserError JSON.parse(value) def parse_json(value) end end body UI.user_error!("Please provide valid JSON, or a hash as request body") unless parse_json(body) else body.to_json elsif body.kind_of?(Array) body.to_json elsif body.kind_of?(Hash)