Apply copilot comments and fix CI

Signed-off-by: abdellahhanane <abdellahhanane44@gmail.com>
This commit is contained in:
abdellahhanane
2026-03-05 08:21:35 -05:00
parent a761a48331
commit df21ef6330
3 changed files with 10 additions and 11 deletions
@@ -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,
@@ -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,
});
});
@@ -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) {