Skip to content

Commit 1f6e6ee

Browse files
Copilotsneha-krip
andcommitted
Add test for return_run_details: false and remove API version comment
Co-authored-by: sneha-krip <110618720+sneha-krip@users.noreply.github.com>
1 parent 3b1797a commit 1f6e6ee

2 files changed

Lines changed: 13 additions & 1 deletion

File tree

lib/octokit/client/actions_workflows.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ 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
# @param options [Hash] Optional parameters
39-
# @option options [Boolean] :return_run_details Fetch run details (needs API 2022-11-28)
39+
# @option options [Boolean] :return_run_details Fetch run details
4040
#
4141
# @return [Boolean, Sawyer::Resource] Boolean success or run details
4242
# @see https://docs.github.com/en/rest/reference/actions#create-a-workflow-dispatch-event

spec/octokit/client/actions_workflows_spec.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,18 @@
5555
assert_requested request
5656
end
5757

58+
context 'with return_run_details option explicitly false' do
59+
it 'returns a boolean' do
60+
wf_file = 'simple_workflow.yml'
61+
http_stub = stub_post("/repos/#{@test_repo}/actions/workflows/#{wf_file}/dispatches")
62+
63+
output = @client.workflow_dispatch(@test_repo, wf_file, 'main', return_run_details: false)
64+
65+
expect(output).to be(true).or be(false)
66+
assert_requested http_stub
67+
end
68+
end
69+
5870
context 'with return_run_details option' do
5971
it 'gets run details from API response' do
6072
wf_file = 'simple_workflow.yml'

0 commit comments

Comments
 (0)