Skip to content

Commit de55c4c

Browse files
committed
feat: add cveId support
CVE-ID: CVE-2024-12345
1 parent b671aa8 commit de55c4c

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

commit-stream.js

+2
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ export default function commitStream (ghUser, ghProject) {
4646
commit.reviewers = []
4747
}
4848
commit.reviewers.push({ name: m[1], email: m[2] })
49+
} else if ((m = line.match(/\bCVE-ID:\s+(CVE-\d{4}-\d{5})\b/)) !== null) {
50+
commit.cveId = m[1];
4951
} else if ((m = line.match(/^\s+PR(?:[- ]?URL)?:?\s*(.+)\s*$/) || line.match(/\(#(\d+)\)$/)) !== null) {
5052
commit.prUrl = m[1]
5153
if (

test.js

+23
Original file line numberDiff line numberDiff line change
@@ -224,3 +224,26 @@ test('current commit log with ghUser and ghRepo passed', function (t) {
224224
}, 'got correct pr url for green-button merge')
225225
})
226226
})
227+
228+
test('cve id', function (t) {
229+
gitToList(t, 'git log', 'rvagg', 'commit-stream', function (err, list) {
230+
t.error(err, 'no error')
231+
232+
t.ok(list && list.length > 1, 'got a list')
233+
234+
t.deepEqual(list[list.length - 18], {
235+
sha: 'b23208796d7e3fd08b36f6106aa7f027aa827137',
236+
authors: [
237+
{ name: 'Rich Trott', email: '[email protected]' }
238+
],
239+
authorDate: 'Mon Oct 11 19:29:18 2021 -0700',
240+
prUrl: 'https://github.com/rvagg/commit-stream/pull/5',
241+
ghIssue: 5,
242+
ghUser: 'rvagg',
243+
ghProject: 'commit-stream',
244+
author: { name: 'Rich Trott', email: '[email protected]' },
245+
summary: 'chore: update strip-ansi to 6.x',
246+
cveId: ''
247+
}, 'got correct pr url for green-button merge')
248+
})
249+
})

0 commit comments

Comments
 (0)