Support return_run_details parameter in workflow_dispatch#1
Conversation
Co-authored-by: sneha-krip <110618720+sneha-krip@users.noreply.github.com>
Co-authored-by: sneha-krip <110618720+sneha-krip@users.noreply.github.com>
| context 'with return_run_details option' do | ||
| it 'gets run details from API response' do | ||
| wf_file = 'simple_workflow.yml' | ||
| api_response_body = { id: 123, status: 'queued' }.to_json |
There was a problem hiding this comment.
Here's an example request that shows what the response body looks like
curl -L -X POST -H "Accept: application/vnd.github+json" -H "Authorization: Bearer $PAT" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/github/sneha-krip-demo/actions/workflows/177005888/dispatches -d '{"ref":"main"}'
{
"workflow_run_id": 22103568458,
"run_url": "https://api.github.com/repos/github/sneha-krip-demo/actions/runs/22103568458",
"html_url": "https://github.com/github/sneha-krip-demo/actions/runs/22103568458"
}
There was a problem hiding this comment.
@copilot Can we update to more closely resemble what the response body would actually be
There was a problem hiding this comment.
Updated the test to use the actual GitHub API response format with workflow_run_id, run_url, and html_url fields as shown in your example. (commit 1607fe2)
There was a problem hiding this comment.
@copilot Workflow run ID should look like 22103568458, not 22_103_568_458
There was a problem hiding this comment.
Updated to use 22103568458 without underscores in the test to match the actual API response format. Added rubocop disable comments to preserve this formatting. (commit 6bada3c)
Co-authored-by: sneha-krip <110618720+sneha-krip@users.noreply.github.com>
Co-authored-by: sneha-krip <110618720+sneha-krip@users.noreply.github.com>
Implementation Plan for workflow_dispatch return_run_details Support
workflow_dispatchmethod inlib/octokit/client/actions_workflows.rbreturn_run_detailsoptionpostwhenreturn_run_detailsis true,boolean_from_responseotherwisespec/octokit/client/actions_workflows_spec.rbreturn_run_details: truescenarioboolean_from_responsewas not modifiedOriginal prompt
This pull request was created from Copilot chat.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.