github.github.onworkflowrun
Home > @runlightyear/github > GitHub > onWorkflowRun
GitHub.onWorkflowRun() method
This event occurs when there is activity relating to a run of a GitHub Actions workflow.
For activity relating to a job in a workflow run, use the workflow_job event.
Signature:static onWorkflowRun(props: GitHubListenerProps<WorkflowRunPayload>): {
webhook: string;
action: string;
};
Parameters
Parameter | Type | Description |
---|---|---|
props | GitHubListenerProps<WorkflowRunPayload> |
{ webhook: string; action: string; }
Example
On workflow run completed
import { GitHub } from "@runlightyear/github";
import { SKIPPED } from "@runlightyear/lightyear";
GitHub.onWorkflowRun({
name: "onWorkflowRunComplete",
title: "On Workflow Run Complete",
run: async ({ data, auths }) => {
console.log("Workflow run data: ", data);
if (data.action !== "completed") {
throw SKIPPED;
}
console.log("Workflow run completed:", data);
},
});