Skip to content

Commit

Permalink
feature: add support for ghe
Browse files Browse the repository at this point in the history
  • Loading branch information
codezninja committed Apr 4, 2022
1 parent 5313807 commit 48ce168
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,29 @@ jobs:
...
```

## GHE Support

For GHE support you just need to pass in `api-endpoint` as an input.

```yml
name: Publish

on: [push]

jobs:
publish:
name: Publish the package
runs-on: ubuntu-latest
steps:
- name: Wait for tests to succeed
uses: lewagon/wait-on-check-action@v1.0.0
with:
ref: ${{ github.ref }}
check-name: 'Run tests'
repo-token: ${{ secrets.GITHUB_TOKEN }}
api-endpoint: https://{YOU_GHE_URL}/api/v3/
...
```
## Alternatives

If you can keep the dependent jobs in a single workflow:
Expand Down
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ inputs:
description: "Seconds to wait between Checks API requests"
required: false
default: "10"
api-endpoint:
description: "Github API Endpoint to use."
required: false
default: ""
running-workflow-name:
description: "Name of the workflow to be ignored (the one who is waiting for the rest)"
required: false
Expand Down Expand Up @@ -68,6 +72,7 @@ runs:
VERBOSE: ${{ inputs.verbose }}
WAIT_INTERVAL: ${{ inputs.wait-interval }}
RUNNING_WORKFLOW_NAME: ${{ inputs.running-workflow-name }}
API_ENDPOINT: ${{ inputs.api-endpoint }}
branding:
icon: "check-circle"
color: "green"
3 changes: 2 additions & 1 deletion entrypoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@
verbose = ENV["VERBOSE"]
wait = ENV["WAIT_INTERVAL"]
workflow_name = ENV["RUNNING_WORKFLOW_NAME"]
api_endpoint = ENV['API_ENDPOINT'] || 'https://api.github.com'

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(access_token: token)
config.client = Octokit::Client.new(access_token: token, api_endpoint: api_endpoint)
config.ref = ref
config.repo = ENV["GITHUB_REPOSITORY"]
config.verbose = verbose
Expand Down

0 comments on commit 48ce168

Please sign in to comment.