Skip to content

Commit

Permalink
fixup! fixup! test: add cveId tests
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaelGSS committed Nov 19, 2024
1 parent b7a715a commit 4c0290f
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions commit-to-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ export const formatType = {

function toStringPlaintext (data) {
let s = ''

if (data.cveId) {
const pr = data.pr ? data.prUrl : ''
return ` * ${data.cveId} - ${data.summary.trim()} - ${pr}`
s += `(${data.cveId})`
}

s += (data.semver || []).length ? `(${data.semver.join(', ').toUpperCase()}) ` : ''
Expand Down Expand Up @@ -98,11 +98,7 @@ function toStringMarkdown (data) {
}

function toStringMessageOnly (data) {
let cveData = ''
if (data.cveId) {
cveData = `${data.cveId} - `
}
return ` * ${cveData}${data.summary.trim()}`
return ` * ${data.cveId ? '(' + data.cveId + ') ' : ''}${data.summary.trim()}`
}

export function commitToOutput (commit, format, ghId, commitUrl) {
Expand Down

0 comments on commit 4c0290f

Please sign in to comment.