diff --git a/README.md b/README.md index a9236f5..bdc01f0 100644 --- a/README.md +++ b/README.md @@ -65,7 +65,7 @@ jobs: ref: ${{ github.ref }} check-name: 'Run tests' repo-token: ${{ secrets.GITHUB_TOKEN }} - api-endpoint: https://{YOU_GHE_URL}/api/v3/ + api-endpoint: YOUR_GHE_API_BASE_URL # Fed to https://octokit.github.io/octokit.rb/Octokit/Configurable.html#api_endpoint-instance_method ... ``` ## Alternatives diff --git a/entrypoint.rb b/entrypoint.rb index b072b88..1793097 100755 --- a/entrypoint.rb +++ b/entrypoint.rb @@ -10,14 +10,15 @@ verbose = ENV["VERBOSE"] wait = ENV["WAIT_INTERVAL"] workflow_name = ENV["RUNNING_WORKFLOW_NAME"] -api_endpoint = ENV.fetch("API_ENDPOINT", "https://api.github.com") +api_endpoint = ENV.fetch("API_ENDPOINT", "") GithubChecksVerifier.configure do |config| config.allowed_conclusions = allowed_conclusions.split(",").map(&:strip) config.check_name = check_name config.check_regexp = check_regexp config.client = Octokit::Client.new(auto_paginate: true) - config.client.access_token = token unless token.empty? + config.client.api_endpoint = api_endpoint unless /\A[[:space:]]*\z/.match?(api_endpoint) + config.client.access_token = token config.ref = ref config.repo = ENV["GITHUB_REPOSITORY"] config.verbose = verbose