-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathentrypoint.rb
executable file
·34 lines (29 loc) · 1.18 KB
/
entrypoint.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env ruby
# frozen_string_literal: true
require_relative 'app/services/github_checks_verifier'
require 'octokit'
allowed_conclusions = ENV.fetch('ALLOWED_CONCLUSIONS', nil)
check_name = ENV.fetch('CHECK_NAME', nil)
check_regexp = ENV.fetch('CHECK_REGEXP', nil)
ref = ENV.fetch('REF', nil)
token = ENV.fetch('REPO_TOKEN', nil)
verbose = ENV.fetch('VERBOSE', nil)
wait = ENV.fetch('WAIT_INTERVAL', nil)
workflow_name = ENV.fetch('RUNNING_WORKFLOW_NAME', nil)
api_endpoint = ENV.fetch('API_ENDPOINT', '')
ignore_checks = ENV.fetch('IGNORE_CHECKS', nil)
GithubChecksVerifier.configure do |config|
config.allowed_conclusions = allowed_conclusions.split(',').map(&:strip)
config.ignore_checks = ignore_checks.split(',').map(&:strip)
config.check_name = check_name
config.check_regexp = check_regexp
config.client = Octokit::Client.new(auto_paginate: true)
config.client.api_endpoint = api_endpoint unless /\A[[:space:]]*\z/.match?(api_endpoint)
config.client.access_token = token
config.ref = ref
config.repo = ENV.fetch('GITHUB_REPOSITORY', nil)
config.verbose = verbose == 'true'
config.wait = wait.to_i
config.workflow_name = workflow_name
end
GithubChecksVerifier.call