Skip to content

Commit

Permalink
Merge pull request #34 from matrix-org/t3chguy/ignore-comments
Browse files Browse the repository at this point in the history
Ignore commands in the comments
  • Loading branch information
t3chguy committed Jul 27, 2022
2 parents f99923e + 2b2c91b commit fc80982
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/changes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const ISSUE_URL_REGEXP =

const MERGE_COMMIT_REGEX = /Merge pull request #(\d+) from (.*)/;

const COMMENT_REGEXP = /<!--(.*?)-->/s;
const MAGIC_COMMENT_REGEXP = /<!-- CHANGELOG_PREVIEW_START -->(.*)<!-- CHANGELOG_PREVIEW_END -->/s;

export enum ChangeType {
Expand Down Expand Up @@ -198,7 +199,7 @@ export function changeFromPrInfo(pr: PrInfo): IChange {
const fixes = new Map<string, IIssueID>();

if (pr.body) {
const bodyMainContent = pr.body.replace(MAGIC_COMMENT_REGEXP, "");
const bodyMainContent = pr.body.replace(MAGIC_COMMENT_REGEXP, "").replace(COMMENT_REGEXP, "");
for (const line of bodyMainContent.split("\n")) {
const trimmed = line.trim();
if (trimmed.toLowerCase().startsWith(NOTES_MAGIC_TEXT)) {
Expand Down

0 comments on commit fc80982

Please sign in to comment.