Skip to content

Commit ded14fc

Browse files
committed
Add coverage link article
1 parent 931e4ce commit ded14fc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ jobs:
2323
run: |
2424
go test -bench=.
2525
- name: Generate coverage Status
26+
# From https://itnext.io/github-actions-code-coverage-without-third-parties-f1299747064d
2627
run: |
2728
set -x
2829
total=`go tool cover -func=coverage.out | grep total | grep -Eo '[0-9]+\.[0-9]+'`
30+
2931
curl "https://${GIT_USER}:${GIT_TOKEN}@api.github.com/repos/otaviog/goheap/statuses/${COMMIT_SHA}" -d "{\"state\": \"success\",\"target_url\": \"https://github.com/otaviog/goheap/pull/${PULL_NUMBER}/checks?check_run_id=${RUN_ID}\",\"description\": \"${total}%\",\"context\": \"code cov\"}"
3032
env:
3133
GIT_TOKEN: ${{ secrets.GIT_TOKEN }}

0 commit comments

Comments
 (0)