From 6aa109828d05a9b5dce7ab3a0436ee8c1c1f1410 Mon Sep 17 00:00:00 2001 From: blam Date: Sun, 7 Mar 2021 17:56:07 +0100 Subject: [PATCH] docs: updating the example action to be valid typescript :) Signed-off-by: blam --- docs/features/software-templates/writing-custom-actions.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/features/software-templates/writing-custom-actions.md b/docs/features/software-templates/writing-custom-actions.md index 36d51decb5..2a48a014d6 100644 --- a/docs/features/software-templates/writing-custom-actions.md +++ b/docs/features/software-templates/writing-custom-actions.md @@ -19,7 +19,7 @@ passed as `input` to the function. In `packages/backend/src/actions/custom.ts` we can create a new action. ```ts -import { createTemplateAction } from '../../createTemplateAction'; +import { createTemplateAction } from '@backstage/plugin-scaffolder-backend'; import fs from 'fs-extra'; export const createNewFileAction = () => { @@ -35,7 +35,7 @@ export const createNewFileAction = () => { title: 'Contents', description: 'The contents of the file', }, - contents: { + filename: { type: 'string', title: 'Filename', description: 'The filename of the file that will be created', @@ -46,7 +46,7 @@ export const createNewFileAction = () => { async handler(ctx) { await fs.outputFile( `${ctx.workspacePath}/${ctx.input.filename}`, - ctx.input.content, + ctx.input.contents, ); }, });