scaffolder-backend: enable dry-run support in some actions

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-04-04 10:13:09 +02:00
parent 10b7b2d9c7
commit fe9a710adb
7 changed files with 18 additions and 0 deletions
@@ -84,6 +84,18 @@ export function createCatalogRegisterAction(options: {
},
],
},
output: {
type: 'object',
required: ['catalogInfoUrl'],
properties: {
entityRef: {
type: 'string',
},
catalogInfoUrl: {
type: 'string',
},
},
},
},
async handler(ctx) {
const { input } = ctx;
@@ -46,6 +46,7 @@ export function createCatalogWriteAction() {
},
},
},
supportsDryRun: true,
async handler(ctx) {
ctx.logStream.write(`Writing catalog-info.yaml`);
const { filePath, entity } = ctx.input;
@@ -51,6 +51,7 @@ export function createDebugLogAction() {
},
},
},
supportsDryRun: true,
async handler(ctx) {
ctx.logger.info(JSON.stringify(ctx.input, null, 2));
@@ -54,6 +54,7 @@ export function createFetchPlainAction(options: {
},
},
},
supportsDryRun: true,
async handler(ctx) {
ctx.logger.info('Fetching plain content from remote URL');
@@ -101,6 +101,7 @@ export function createFetchTemplateAction(options: {
},
},
},
supportsDryRun: true,
async handler(ctx) {
ctx.logger.info('Fetching template content from remote URL');
@@ -42,6 +42,7 @@ export const createFilesystemDeleteAction = () => {
},
},
},
supportsDryRun: true,
async handler(ctx) {
if (!Array.isArray(ctx.input?.files)) {
throw new InputError('files must be an Array');
@@ -66,6 +66,7 @@ export const createFilesystemRenameAction = () => {
},
},
},
supportsDryRun: true,
async handler(ctx) {
if (!Array.isArray(ctx.input?.files)) {
throw new InputError('files must be an Array');