From 203783ba48db0004a674601a4d12cd044eee27d2 Mon Sep 17 00:00:00 2001 From: jvmdc <109624469+jvmdc@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:56:49 +0100 Subject: [PATCH] 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> --- docs/features/software-templates/writing-custom-actions.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 11e67af07f..1eb331f7b9 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -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