Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determining result of Workflow Dispatch #1380

Closed
BenF99 opened this issue Feb 24, 2022 · 6 comments · Fixed by #1455
Closed

Determining result of Workflow Dispatch #1380

BenF99 opened this issue Feb 24, 2022 · 6 comments · Fixed by #1455

Comments

@BenF99
Copy link

BenF99 commented Feb 24, 2022

Unable to identify the cause of failure for workflow dispatch event

image

As we known, dispatch doesn't return anything, making it extremely difficult to identify the cause of failure for a workflow trigger.
As an example, assume a workflow requires a specific input which is not provided in the call - the method has no way of providing us with such information on failure.

Do we have a way to identify at minimum the status code returned from the dispatch?

@gsmet
Copy link
Contributor

gsmet commented Feb 24, 2022

It might need some tweaking if the status code is not a success. I'm not sure if GitHub validates the inputs so early though.

If you can reliably reproduce the error, I would try to differentiate the status code (not sure what is a success in this case) and throw an exception with the error message returned from GitHub.

@ketronkowski
Copy link

I have a case where a 403 is being returned from the GitHub "dispatches" API call, it would be very useful for the method caller (of dispatch(...)) to know that information through a thrown IOException based on receiving a 400/500 error from the Github API.

@gsmet
Copy link
Contributor

gsmet commented May 12, 2022

I'm working on fixing it, PR to come.

@ketronkowski
Copy link

Awesome, Thanks!

gsmet added a commit to gsmet/github-api that referenced this issue May 12, 2022
Fixes hub4j#1380

Note: I had to take a new snapshot for GHWorkflowTest as the dispatch
tests was silently failing before (we were using an input that was not
declared in the workflow, I fixed that in the test workflow).
@gsmet
Copy link
Contributor

gsmet commented May 12, 2022

PR is here: #1455 .

I don't know what I was thinking when I implemented it...

@ketronkowski
Copy link

Will a new release of the API come out soon with this fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants