diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.examples.test.ts b/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.examples.test.ts index b917efbf28..077af89c2a 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.examples.test.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.examples.test.ts @@ -93,7 +93,6 @@ describe('github:actions:dispatch', () => { ).toHaveBeenCalledWith({ owner: 'owner', repo: 'repo', - return_run_details: false, workflow_id: workflowId, ref: branchOrTagName, }); @@ -120,7 +119,6 @@ describe('github:actions:dispatch', () => { ).toHaveBeenCalledWith({ owner: 'owner', repo: 'repo', - return_run_details: false, workflow_id: workflowId, ref: branchOrTagName, inputs: workflowInputs, diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.test.ts b/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.test.ts index 67f0cf3e82..fc8cfcce0b 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.test.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.test.ts @@ -101,7 +101,6 @@ describe('github:actions:dispatch', () => { repo: 'repo', workflow_id: workflowId, ref: branchOrTagName, - return_run_details: false, }); }); @@ -129,7 +128,6 @@ describe('github:actions:dispatch', () => { workflow_id: workflowId, ref: branchOrTagName, inputs: workflowInputs, - return_run_details: false, }); }); diff --git a/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.ts b/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.ts index cc2f5f13e8..c882869085 100644 --- a/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.ts +++ b/plugins/scaffolder-backend-module-github/src/actions/githubActionsDispatch.ts @@ -126,14 +126,17 @@ export function createGithubActionsDispatchAction(options: { const runDetails = await ctx.checkpoint({ key: `create.workflow.dispatch.${owner}.${repo}.${workflowId}`, fn: async () => { - const response = await client.rest.actions.createWorkflowDispatch({ + const dispatchParams = { owner, repo, workflow_id: workflowId, ref: branchOrTagName, inputs: workflowInputs, - return_run_details: returnWorkflowRunDetails ?? false, - }); + ...(returnWorkflowRunDetails ? { return_run_details: true } : {}), + }; + const response = await client.rest.actions.createWorkflowDispatch( + dispatchParams, + ); ctx.logger.info(`Workflow ${workflowId} dispatched successfully`); @@ -151,8 +154,8 @@ export function createGithubActionsDispatchAction(options: { }; return { - workflow_run_id: data.workflow_run_id, - run_url: data.run_url, + workflowRunId: data.workflow_run_id, + workflowRunUrl: data.run_url, workflowRunHtmlUrl: data.html_url, }; } @@ -161,8 +164,8 @@ export function createGithubActionsDispatchAction(options: { }); if (runDetails) { - ctx.output('workflowRunId', runDetails.workflow_run_id); - ctx.output('workflowRunUrl', runDetails.run_url); + ctx.output('workflowRunId', runDetails.workflowRunId); + ctx.output('workflowRunUrl', runDetails.workflowRunUrl); ctx.output('workflowRunHtmlUrl', runDetails.workflowRunHtmlUrl); } } catch (e) {