Skip to content

Commit

Permalink
fix: format metadata object correctly & don't print ^$
Browse files Browse the repository at this point in the history
Follow-up to e8b95de
  • Loading branch information
jamacku committed Apr 27, 2023
1 parent 39ea352 commit 3032618
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ export default class MetadataController {
this.schema = {
id: verifiedID,
template: {
before: '^<!-- ',
after: ' -->$',
before: '<!-- ',
after: ' -->',
},
};

this.regexp = new RegExp(
`${this.schema.template.before}${verifiedID} = (.*)${this.schema.template.after}`,
`^${this.schema.template.before}${verifiedID} = (.*)${this.schema.template.after}$`,
'm'
);
}
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 3032618

Please sign in to comment.