Made "github:actions:dispatch" action idempotent
Signed-off-by: Bogdan Nechyporenko <bnechyporenko@bol.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend-module-github': patch
|
||||
---
|
||||
|
||||
Made "github:actions:dispatch" action idempotent
|
||||
@@ -115,15 +115,20 @@ export function createGithubActionsDispatchAction(options: {
|
||||
}),
|
||||
);
|
||||
|
||||
await client.rest.actions.createWorkflowDispatch({
|
||||
owner,
|
||||
repo,
|
||||
workflow_id: workflowId,
|
||||
ref: branchOrTagName,
|
||||
inputs: workflowInputs,
|
||||
});
|
||||
await ctx.checkpoint({
|
||||
key: `create.workflow.dispatch.${owner}.${repo}.${workflowId}`,
|
||||
fn: async () => {
|
||||
await client.rest.actions.createWorkflowDispatch({
|
||||
owner,
|
||||
repo,
|
||||
workflow_id: workflowId,
|
||||
ref: branchOrTagName,
|
||||
inputs: workflowInputs,
|
||||
});
|
||||
|
||||
ctx.logger.info(`Workflow ${workflowId} dispatched successfully`);
|
||||
ctx.logger.info(`Workflow ${workflowId} dispatched successfully`);
|
||||
},
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user