diff --git a/src/lib/ctx.ts b/src/lib/ctx.ts index 1b176e6..854731b 100644 --- a/src/lib/ctx.ts +++ b/src/lib/ctx.ts @@ -245,7 +245,8 @@ export default (options: Record): Context => { approvalThreshold: config.approvalThreshold, rejectionThreshold: config.rejectionThreshold, showRenderErrors: config.showRenderErrors ?? false, - customCSS: (config as any).customCSS + customCSS: (config as any).customCSS, + tags: config.tags || [] }, uploadFilePath: '', webStaticConfig: [], diff --git a/src/lib/httpClient.ts b/src/lib/httpClient.ts index bd740dd..a783ffb 100644 --- a/src/lib/httpClient.ts +++ b/src/lib/httpClient.ts @@ -836,6 +836,7 @@ export default class httpClient { if (ctx.git?.commitId) form.append('commitId', ctx.git.commitId); if (ctx.git?.commitAuthor) form.append('commitAuthor', ctx.git.commitAuthor); if (ctx.git?.commitMessage) form.append('commitMessage', ctx.git.commitMessage); + if (ctx.config.tags?.length) form.append('tags', ctx.config.tags.join(',')); try { const response = await this.axiosInstance.request({ diff --git a/src/lib/schemaValidation.ts b/src/lib/schemaValidation.ts index 76951d6..ceb9bbe 100644 --- a/src/lib/schemaValidation.ts +++ b/src/lib/schemaValidation.ts @@ -389,6 +389,22 @@ const ConfigSchema = { showRenderErrors: { type: "boolean", errorMessage: "Invalid config; showRenderErrors must be true/false" + }, + tags: { + type: "array", + items: { + type: "string", + minLength: 1, + maxLength: 50, + errorMessage: "Invalid config; each tag must be a non-empty string of at most 50 characters" + }, + maxItems: 50, + uniqueItems: true, + errorMessage: { + type: "Invalid config; tags must be an array of strings", + maxItems: "Invalid config; at most 50 tags are allowed", + uniqueItems: "Invalid config; tags must be unique" + } } }, anyOf: [ diff --git a/src/types.ts b/src/types.ts index 364f07f..be83d61 100644 --- a/src/types.ts +++ b/src/types.ts @@ -48,6 +48,7 @@ export interface Context { rejectionThreshold?: number; showRenderErrors?: boolean; customCSS?: string; + tags?: string[]; }; uploadFilePath: string; // documents awaiting sync results, filled at upload time so polling knows what to ask for