From 303261814c6025199a0966f49af90f16b94b456d Mon Sep 17 00:00:00 2001 From: Jan Macku Date: Thu, 27 Apr 2023 12:47:44 +0200 Subject: [PATCH] fix: format metadata object correctly & don't print `^$` Follow-up to https://github.com/redhat-plumbers-in-action/issue-metadata/commit/e8b95dea4a23f95e26ae6364538f4753fca6120b --- src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/index.ts b/src/index.ts index b0bdab4..5074460 100644 --- a/src/index.ts +++ b/src/index.ts @@ -17,13 +17,13 @@ export default class MetadataController { this.schema = { id: verifiedID, template: { - before: '^$', + before: '', }, }; this.regexp = new RegExp( - `${this.schema.template.before}${verifiedID} = (.*)${this.schema.template.after}`, + `^${this.schema.template.before}${verifiedID} = (.*)${this.schema.template.after}$`, 'm' ); } @@ -122,7 +122,7 @@ export default class MetadataController { await request('PATCH /repos/{owner}/{repo}/issues/{issue_number}', { ...this.requestDefaults, issue_number: issue, - body: `${body}${this.schema.template.before}${ + body: `${body}\n\n${this.schema.template.before}${ this.schema.id } = ${JSON.stringify(data)}${this.schema.template.after}`, ...requestMock.patch,