From 51bf762181dbc798c7bd4e22cd4feab59e004df1 Mon Sep 17 00:00:00 2001 From: Fabio Vincenzi Date: Fri, 13 Dec 2024 18:22:14 +0100 Subject: [PATCH] make task not optional in ActionContext Signed-off-by: Fabio Vincenzi --- .changeset/famous-dryers-protect.md | 3 ++- .changeset/wise-students-tell.md | 5 ----- plugins/scaffolder-node/report.api.md | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 .changeset/wise-students-tell.md diff --git a/.changeset/famous-dryers-protect.md b/.changeset/famous-dryers-protect.md index f1da5fc511..b015a562aa 100644 --- a/.changeset/famous-dryers-protect.md +++ b/.changeset/famous-dryers-protect.md @@ -1,5 +1,6 @@ --- '@backstage/plugin-scaffolder-backend': minor +'@backstage/plugin-scaffolder-node': patch --- -New `taskId` Context Variable in Scaffolder Templates +Added the ability to use `${{ context.task.id }}` in nunjucks templating, as well as `ctx.task.id` in actions to get the current task ID. diff --git a/.changeset/wise-students-tell.md b/.changeset/wise-students-tell.md deleted file mode 100644 index 12acb5f892..0000000000 --- a/.changeset/wise-students-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@backstage/plugin-scaffolder-node': patch ---- - -Add task id to ActionContext diff --git a/plugins/scaffolder-node/report.api.md b/plugins/scaffolder-node/report.api.md index a8f7b4da67..1141f0ada0 100644 --- a/plugins/scaffolder-node/report.api.md +++ b/plugins/scaffolder-node/report.api.md @@ -41,7 +41,7 @@ export type ActionContext< ): void; createTemporaryDirectory(): Promise; getInitiatorCredentials(): Promise; - task?: { + task: { id: string; }; templateInfo?: TemplateInfo;