Skip to content

Commit

Permalink
Merge pull request backstage#28375 from jvmdc/patch-2
Browse files Browse the repository at this point in the history
Fix checkpoint example in "Writing custom actions"
  • Loading branch information
benjdlambert authored Jan 28, 2025
2 parents e59af9c + 91af968 commit 90f73c6
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions docs/features/software-templates/writing-custom-actions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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();

return {
projectStgId,
projectProId,
};
const res = await ctx.checkpoint?.({
key: 'create.projects',
fn: async () => {
const projectStgId = createStagingProjectId();
const projectProId = createProductionProjectId();

return {
projectStgId,
projectProId,
};
},
});
```

Expand Down

0 comments on commit 90f73c6

Please sign in to comment.