utils/github: add workflow_dispatch_event method

This commit is contained in:
Dawid Dziurla 2020-07-09 12:50:09 +02:00
parent 146eca4608
commit de4f25c13d
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B

View File

@ -450,6 +450,13 @@ module GitHub
scopes: CREATE_ISSUE_FORK_OR_PR_SCOPES)
end
def workflow_dispatch_event(user, repo, workflow, ref, **inputs)
url = "#{API_URL}/repos/#{user}/#{repo}/actions/workflows/#{workflow}/dispatches"
open_api(url, data: { ref: ref, inputs: inputs },
request_method: :POST,
scopes: CREATE_ISSUE_FORK_OR_PR_SCOPES)
end
def get_artifact_url(user, repo, pr, workflow_id: "tests.yml", artifact_name: "bottles")
scopes = CREATE_ISSUE_FORK_OR_PR_SCOPES
base_url = "#{API_URL}/repos/#{user}/#{repo}"