Skip to content

Commit

Permalink
feat: update PULL_NUMBER_REG
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Sep 7, 2024
1 parent fb9407f commit 80cb53c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 29 deletions.
2 changes: 1 addition & 1 deletion src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down
42 changes: 14 additions & 28 deletions test/__snapshots__/regexp.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
]
Expand Down

0 comments on commit 80cb53c

Please sign in to comment.