Fix checkpoint example in "Writing custom actions"
The example was not using the correct parameters for setting up the checkpoint - You pass in an `opts` object rather than individual parameters. Signed-off-by: jvmdc <109624469+jvmdc@users.noreply.github.com>
This commit is contained in:
@@ -263,7 +263,7 @@ 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?.('create.projects', async () => {
|
||||
const res = await ctx.checkpoint?.({key: 'create.projects', fn: async () => {
|
||||
const projectStgId = createStagingProjectId();
|
||||
const projectProId = createProductionProjectId();
|
||||
|
||||
@@ -271,7 +271,7 @@ const res = await ctx.checkpoint?.('create.projects', async () => {
|
||||
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