Skip to content

Commit 0038c82

Browse files
committed
fix: only display path in PR comment when not default
1 parent 508f4c7 commit 0038c82

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/update-comment.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ const updateCodeCoverageComment = module.exports = async ({ context, github }, p
1414

1515
const coverageText = fs.readFileSync(`go-cover/${revision}.txt`, 'utf8').split('\n').slice(0, -1)
1616
const coverageTextSummary = coverageText[coverageText.length-1].split('\t').pop()
17+
const pathText = path === './' ? ` for \`${path}/\`` : ''
1718

1819
const commentBody = [
1920
`<!-- coverage (${path})-->`,
20-
`### [Code Coverage Report 🔗](https://${context.repo.owner}.github.io/${context.repo.repo}/?hash=${revision}) for \`${path}/\` at ${revision}`,
21+
`### [Code Coverage Report 🔗](https://${context.repo.owner}.github.io/${context.repo.repo}/?hash=${revision})${pathText} at ${revision}`,
2122
'```',
2223
`Total: ${coverageTextSummary}`,
2324
'```',

0 commit comments

Comments
 (0)