diff --git a/plugins/scaffolder/src/api.ts b/plugins/scaffolder/src/api.ts index 70ed803ef7..767d3ac736 100644 --- a/plugins/scaffolder/src/api.ts +++ b/plugins/scaffolder/src/api.ts @@ -70,7 +70,11 @@ export interface ScaffolderApi { * @param templateName - Name of the Template entity for the scaffolder to use. New project is going to be created out of this template. * @param values - Parameters for the template, e.g. name, description */ - scaffold(templateName: string, values: Record): Promise; + scaffold( + templateName: string, + values: Record, + secrets?: JsonObject, + ): Promise; getTask(taskId: string): Promise; @@ -155,6 +159,7 @@ export class ScaffolderClient implements ScaffolderApi { async scaffold( templateName: string, values: Record, + secrets: JsonObject = {}, ): Promise { const { token } = await this.identityApi.getCredentials(); const url = `${await this.discoveryApi.getBaseUrl('scaffolder')}/v2/tasks`; @@ -164,7 +169,11 @@ export class ScaffolderClient implements ScaffolderApi { 'Content-Type': 'application/json', ...(token && { Authorization: `Bearer ${token}` }), }, - body: JSON.stringify({ templateName, values: { ...values } }), + body: JSON.stringify({ + templateName, + values: { ...values }, + secrets: secrets, + }), }); if (response.status !== 201) {