diff --git a/src/renderer.ts b/src/renderer.ts index f93996c..b2210e3 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -6,7 +6,7 @@ const fixLabel = ['fix', 'bug', 'hotfix'] const breakingLabel = ['break', 'breaking', 'breaking changes'] const featureLabel = ['feature', 'feat', 'enhancement'] export const CHANGELOG_REG = /-\s([A-Z]+)(?:\(([A-Z\s]*)\))?:\s(.+)/gi -export const PULL_NUMBER_REG = /in\shttps:\/\/github\.com\/.+\/pull\/(\d+)\s/g +export const PULL_NUMBER_REG = /in\shttps:\/\/github\.com\/.+\/pull\/(\d+)/g export const SKIP_CHANGELOG_REG = /\[x\] 本条 PR 不需要纳入 changelog/i export function getPullNumbers(body: string) { const arr = [...body.matchAll(PULL_NUMBER_REG)] diff --git a/test/__snapshots__/regexp.test.ts.snap b/test/__snapshots__/regexp.test.ts.snap index ce24d77..0480b36 100644 --- a/test/__snapshots__/regexp.test.ts.snap +++ b/test/__snapshots__/regexp.test.ts.snap @@ -86,73 +86,59 @@ exports[`regexp > : CHANGELOG_REG 1`] = ` exports[`regexp > : PULL_NUMBER_REG 1`] = ` [ [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/7 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/7", "7", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/14 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/14", "14", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/15 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/15", "15", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/16 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/16", "16", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/17 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/17", "17", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/18 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/18", "18", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/19 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/19", "19", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/20 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/20", "20", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/21 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/21", "21", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/23 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/23", "23", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/25 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/25", "25", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/26 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/26", "26", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/27 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/27", "27", ], [ - "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/28 -", + "in https://github.com/TDesignOteam/tdesign-changelog-action/pull/28", "28", ], ]