Skip to content

Commit

Permalink
rename Dispatch operation and get correct workflowId
Browse files Browse the repository at this point in the history
  • Loading branch information
Stamsy committed Feb 14, 2025
1 parent 638e6a8 commit 75b0ea6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions packages/nodes-base/nodes/Github/Github.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ export class Github implements INodeType {
action: 'Disable a workflow',
},
{
name: 'Dispatch',
name: 'Dispatch Workflow Event',
value: 'dispatch',
description: 'Dispatch a workflow event',
action: 'Dispatch a workflow event',
Expand Down Expand Up @@ -2500,7 +2500,14 @@ export class Github implements INodeType {

requestMethod = 'POST';

const workflowId = this.getNodeParameter('workflowId', i) as string;
const workflowIdObj = this.getNodeParameter('workflowId', i);
const workflowId = (workflowIdObj as IDataObject)?.value as string;

if (!workflowId) {
throw new NodeOperationError(this.getNode(), 'Workflow ID is missing.', {
itemIndex: i,
});
}

endpoint = `/repos/${owner}/${repository}/actions/workflows/${workflowId}/dispatches`;
body.ref = this.getNodeParameter('ref', i) as string;
Expand Down

0 comments on commit 75b0ea6

Please sign in to comment.