@@ -263,15 +263,18 @@ Idempotent action could be achieved via the usage of checkpoints.
|
||||
Example:
|
||||
|
||||
```ts title="plugins/my-company-scaffolder-actions-plugin/src/vendor/my-custom-action.ts"
|
||||
const res = await ctx.checkpoint?.({key: 'create.projects', fn: async () => {
|
||||
const projectStgId = createStagingProjectId();
|
||||
const projectProId = createProductionProjectId();
|
||||
const res = await ctx.checkpoint?.({
|
||||
key: 'create.projects',
|
||||
fn: async () => {
|
||||
const projectStgId = createStagingProjectId();
|
||||
const projectProId = createProductionProjectId();
|
||||
|
||||
return {
|
||||
projectStgId,
|
||||
projectProId,
|
||||
};
|
||||
}});
|
||||
return {
|
||||
projectStgId,
|
||||
projectProId,
|
||||
};
|
||||
},
|
||||
});
|
||||
```
|
||||
|
||||
You have to define the unique key in scope of the scaffolder task for your checkpoint. During the execution task engine
|
||||
|
||||
Reference in New Issue
Block a user