Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
kilianc committed May 14, 2024
1 parent 7403370 commit 21f7d98
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/update-comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ const updateCodeCoverageComment = module.exports = async ({ context, github, pat
const coverageText = fs.readFileSync(`go-cover/${revision}.txt`, 'utf8').split('\n').slice(0, -1)
const coverageTextSummary = coverageText[coverageText.length-1].split('\t').pop()
const coverage = parseFloat(coverageTextSummary.replace('%', ''), 10)
const coverageEmoji = coverage >= threshold ? '' : '🔻 '
const pathText = (path !== './' ? ` for \`${path}/\`` : '').replace('//', '/')
const coverageEmoji = coverage >= threshold ? '' : `<kbd>🔻</kbd> ${threshold - coverage}%`
const pathText = (path !== './' ? ` for <kbd>${path}/</kbd>` : '').replace('//', '/')

const commentBody = [
`<!-- coverage (${path})-->`,
`# ${coverageEmoji}<kbd>[🔗 Code Coverage Report](https://${context.repo.owner}.github.io/${context.repo.repo}/?hash=${revision})${pathText} at ${revision}</kbd>`,
`##### ${coverageEmoji}<kbd>[🔗 Code Coverage Report](https://${context.repo.owner}.github.io/${context.repo.repo}/?hash=${revision})</kbd>${pathText} at <kbd>${revision}</kbd>`,
'```',
`📔 Total: ${coverageTextSummary}`,
]
Expand Down

0 comments on commit 21f7d98

Please sign in to comment.