scaffolder-backend: enable dry-run support in some actions
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user