Skip to content

Commit

Permalink
fix: 日志错误提取了链接
Browse files Browse the repository at this point in the history
  • Loading branch information
liweijie0812 committed Dec 5, 2024
1 parent 90cbbb6 commit 038d4c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const docsLabel = ['docs', 'doc', 'documentation']
const refactorLabel = ['pref', 'refactor']
const noticeLabel = ['notice', 'new component']

export const CHANGELOG_REG = /-\s([A-Z]+)(?:\(([A-Z\s_-]*)\))?\s*:\s*(.+)/gi
export const CHANGELOG_REG = /-\s([A-Z]+)(?:\(([A-Z\s_-]*)\))?\s*:\s(.+)/gi
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) {
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ export const changelog = `
- fix(test-test): test-test
- notice(Component): a new component label in notice
- notice(Icon): a new icon label in notice
- 树形组件选项禁用 https://github.com/Tencent/tdesign-vue-next/issues/4809
- https://github.com/Tencent/tdesign-vue-next/issues/4809
`

export default changelog
2 changes: 1 addition & 1 deletion test/regexp.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import releaseNotes from './fixtures/release-notes'
describe('regexp', () => {
it(': CHANGELOG_REG', () => {
const records = changelog.matchAll(/-\s/g)
expect([...records].length).toBe(21)
expect([...records].length).toBe(23)

const result = changelog.matchAll(CHANGELOG_REG)
const arr = [...result]
Expand Down

0 comments on commit 038d4c5

Please sign in to comment.