Skip to content

Commit

Permalink
Add code coverage comment to PRs
Browse files Browse the repository at this point in the history
Signed-off-by: Justin Kulikauskas <[email protected]>
  • Loading branch information
JustinKuli committed May 5, 2024
1 parent 600c02c commit de291d6
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/code_cov_comment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Code Coverage Comment

on:
pull_request:
types: [opened, reopened]

jobs:
comment:
runs-on: ubuntu-latest
steps:
- uses: actions/github-script@v7
with:
script: |
const branchName = '${{ github.head_ref }}'
const repo = 'JustinKuli/governance-policy-nucleus'
const badgePath = 'https://github.com/' + repo + '/wiki/' + branchName + '/coverage.svg'
const reportPath = 'https://raw.githack.com/wiki/' + repo + '/' + branchName + '/coverage.html'
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: 'Code Coverage Report for this branch (might be slow to update): [![Go Coverage](' + badgePath + ')](' + reportPath + ')'
})

0 comments on commit de291d6

Please sign in to comment.