diff --git a/.changeset/silent-kings-live.md b/.changeset/silent-kings-live.md new file mode 100644 index 0000000000..7e55f5ae78 --- /dev/null +++ b/.changeset/silent-kings-live.md @@ -0,0 +1,5 @@ +--- +'@backstage/plugin-scaffolder-backend': patch +--- + +Removed the depreacated `publish:file` action, use the template editor to test templates instead. diff --git a/plugins/scaffolder-backend/api-report.md b/plugins/scaffolder-backend/api-report.md index 7c24bdc572..123591b1f3 100644 --- a/plugins/scaffolder-backend/api-report.md +++ b/plugins/scaffolder-backend/api-report.md @@ -303,11 +303,6 @@ export function createPublishBitbucketServerAction(options: { token?: string | undefined; }>; -// @public @deprecated -export function createPublishFileAction(): TemplateAction<{ - path: string; -}>; - // @public export function createPublishGerritAction(options: { integrations: ScmIntegrationRegistry; diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/file.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/file.ts deleted file mode 100644 index 52376e39a3..0000000000 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/file.ts +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright 2021 The Backstage Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -import fs from 'fs-extra'; -import { dirname } from 'path'; -import { InputError } from '@backstage/errors'; -import { createTemplateAction } from '../../createTemplateAction'; - -/** - * This task is useful for local development and testing of both the scaffolder - * and scaffolder templates. - * - * @remarks - * - * This action is not installed by default and should not be installed in - * production, as it writes the files to the local filesystem of the scaffolder. - * - * @public - * @deprecated This action will be removed, prefer testing templates using the template editor instead. - */ -export function createPublishFileAction() { - return createTemplateAction<{ path: string }>({ - id: 'publish:file', - description: 'Writes contents of the workspace to a local directory', - schema: { - input: { - type: 'object', - required: ['path'], - properties: { - path: { - title: 'Path to a directory where the output will be written', - type: 'string', - }, - }, - }, - }, - async handler(ctx) { - ctx.logger.warn( - '[DEPRECATED] This action will be removed, prefer testing templates using the template editor instead.', - ); - - const { path } = ctx.input; - - const exists = await fs.pathExists(path); - if (exists) { - throw new InputError('Output path already exists'); - } - await fs.ensureDir(dirname(path)); - await fs.copy(ctx.workspacePath, path); - }, - }); -} diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/index.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/index.ts index 8819c93d08..a8a40ab1df 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/index.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/index.ts @@ -18,7 +18,6 @@ export { createPublishAzureAction } from './azure'; export { createPublishBitbucketAction } from './bitbucket'; export { createPublishBitbucketCloudAction } from './bitbucketCloud'; export { createPublishBitbucketServerAction } from './bitbucketServer'; -export { createPublishFileAction } from './file'; export { createPublishGerritAction } from './gerrit'; export { createPublishGerritReviewAction } from './gerritReview'; export { createPublishGithubAction } from './github';