FindWorkflow had a code path that could error without handling that error
that was introduced in #10328. I previously called out the lack of tests
in this part of the code in my review, and punting them then bit us here:
https://github.com/cli/cli/pull/10328#pullrequestreview-2597266783.
As such, this fixes the panic, but also adds tests to cover the relevant
code paths through FindWorkflow, including some tests for getWorkflowByID,
getWorkflowsByName, and GetWorkflows.
This does NOT seek to refactor the existing code, just cover the existing
behavior and validate that we are resolving this panic (covered by
TestFindWorkflow_nonHTTPError).
The API field `WorkflowRun.name` is not guaranteed to correspond to the workflow name anymore. This introduces additional API lookups that resolve Workflows by their ID and look up their name in a future-proof fashion.
It also adds two new JSON fields for export: `displayTitle` and `workflowName`.
Co-authored-by: Christina Guo <61271066+guo-chris@users.noreply.github.com>
Co-authored-by: Mislav Marohnić <mislav@github.com>