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
Implement workflow job event payload #1331
Comments
The doc is not very clear about how to get this sort of event. By any chance, do you have a full payload for an event like this that we could use in the tests? If so I would encourage you to create a pull request with your code and the payload added (See how it's done in |
I couldn’t figure out how this project is getting its test data, and I’m working on a private repository owned by my client so I don’t know that I’d be allowed to share this event’s actual data. But to get the event you just need to enable “Workflow jobs” events on the repository webhook (https://github.com/{owner}/{repo}/settings/hooks/#####) and then get a workflow to run. GitHub sends a workflow_run event with action “requested” when the workflow is about to start, followed by a workflow_job event with action “queued”, then a workflow_job event with action “in_progress”; and when the workflow finishes GitHub sends a workflow_job event with action “completed” and finally a workflow_run event with action “completed”. |
Describe the bug
#1316 added
WORKFLOW_JOB
to the GHEvent enum, but receiving workflow_job events is still not fully supported because it can’t be mapped to any GHEventPayload subclass. An attempt to map it to the GHEventPayload superclass results in:I’ve captured the request body for a workflow_job event in order to check its structure, and it looks like implementing this is very straightforward. I used the WorkflowRun subclass as a model.
I’ve tested this locally by posting a copy of the workflow_job event to my application’s webhook endpoint, where the application is doing:
The text was updated successfully, but these errors were encountered: