Merge pull request #7954 from dawidd6/workflow-dispatch-event

utils/github: add workflow_dispatch_event method
This commit is contained in:
Dawid Dziurla 2020-07-16 19:08:12 +02:00 committed by GitHub
commit d579725f7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -450,6 +450,13 @@ module GitHub
scopes: CREATE_ISSUE_FORK_OR_PR_SCOPES) scopes: CREATE_ISSUE_FORK_OR_PR_SCOPES)
end 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") def get_artifact_url(user, repo, pr, workflow_id: "tests.yml", artifact_name: "bottles")
scopes = CREATE_ISSUE_FORK_OR_PR_SCOPES scopes = CREATE_ISSUE_FORK_OR_PR_SCOPES
base_url = "#{API_URL}/repos/#{user}/#{repo}" base_url = "#{API_URL}/repos/#{user}/#{repo}"