Skip to content

Commit 403ea69

Browse files
committed
Fix to expect correct response for workflow_dispatch
It looks like GitHub introduced a breaking change in the API response for workflow_dispatch. The API now returns `200 OK` with a response body, while both the documentation[^1] and the SDK[^2] still expect the old `204 No Content` response. ```ruby workflow_run_id: 20363538233, run_url: "https://api.github.com/repos/ubicloud/github-e2e-test-workflows/actions/runs/20363538233", html_url: "https://github.com/ubicloud/github-e2e-test-workflows/actions/runs/20363538233"} > ``` https://github.com/orgs/community/discussions/182272 [^1]: https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#create-a-workflow-dispatch-event--status-codes [^2]: https://github.com/octokit/octokit.rb/blob/ea3413c3174571e87c83d358fc893cc7613091fa/lib/octokit/client/actions_workflows.rb#L41-L43
1 parent ea3413c commit 403ea69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/octokit/client/actions_workflows.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ def workflow(repo, id, options = {})
3636
# @param id [Integer, String] Id or file name of the workflow
3737
# @param ref [String] A SHA, branch name, or tag name
3838
#
39-
# @return [Boolean] True if event was dispatched, false otherwise
39+
# @return [<Sawyer::Resource>] Details of the dispatched workflow run
4040
# @see https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event
4141
def workflow_dispatch(repo, id, ref, options = {})
42-
boolean_from_response :post, "#{Repository.path repo}/actions/workflows/#{id}/dispatches", options.merge({ ref: ref })
42+
post "#{Repository.path repo}/actions/workflows/#{id}/dispatches", options.merge({ ref: ref })
4343
end
4444

4545
# Enable a workflow

0 commit comments

Comments
 (0)