Merge pull request #28375 from jvmdc/patch-2

Fix checkpoint example in "Writing custom actions"
This commit is contained in:
Ben Lambert
2025-01-28 10:08:41 +01:00
committed by GitHub
@@ -263,14 +263,17 @@ 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 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,
};
},
});
```