Skip to content

Commit

Permalink
clean up list formatting for PR comment
Browse files Browse the repository at this point in the history
  • Loading branch information
elireisman committed Jun 4, 2024
1 parent 5460632 commit 0bec1ca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions __tests__/summary.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,13 @@ test('returns minimal summary in case the core.summary is too large for a PR com
expect(text).toContain('<h1>Dependency Review</h1>')
expect(minSummary).toContain('# Dependency Review')

expect(text).toContain('❌ 3 vulnerable package(s)')
expect(text).not.toContain('* ❌ 3 vulnerable package(s)')
expect(text).toContain('lodash')
expect(text).toContain('colors')
expect(text).toContain('@foo/bar')

expect(minSummary).toContain('* ❌ 3 vulnerable package(s)')
expect(minSummary).not.toContain('lodash')
expect(minSummary).not.toContain('colors')
expect(minSummary).not.toContain('@foo/bar')
Expand Down
4 changes: 3 additions & 1 deletion src/summary.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,9 @@ export function addSummaryToSummary(
];

core.summary.addList(summaryList)
out.push(...summaryList)
summaryList.forEach( (line) => {
out.push('* ' + line)
})

core.summary.addRaw('See the Details below.')
out.push(`\n[View full job summary](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID})`)
Expand Down

0 comments on commit 0bec1ca

Please sign in to comment.