Skip to content

Commit fbe8f7e

Browse files
Clean workflow
1 parent bc4d1e5 commit fbe8f7e

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.github/workflows/coverage.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ on:
44
- feature/* # TODO: Remove it
55
- develop
66
- main
7-
env:
8-
# Setting an environment variable with the value of a configuration variable
9-
env_var: ${{ vars.ENV_CONTEXT_VAR }}
107

118
jobs:
129
coverage:
@@ -20,15 +17,18 @@ jobs:
2017
run: (npm run coverage 2>&1) | tee /tmp/coverage.out | cat
2118
- name: Extract coverage
2219
run: echo "COVERAGE=$(cat /tmp/coverage.out | grep "Global test coverage")" >> $GITHUB_ENV
23-
- name: Print coverage
24-
run: echo $COVERAGE
25-
- name: Create Check Run
20+
- name: Create coverage check run # Publish coverage summary to Github PR checks
21+
# See https://docs.github.com/en/rest/checks/runs?apiVersion=2022-11-28#create-a-check-run
22+
# and https://www.kenmuse.com/blog/creating-github-checks/
2623
env:
2724
GH_TOKEN: ${{ github.token }}
28-
run: |
25+
run: | # TODO: Set "failure" conclusion if coverage is too low
2926
curl -L -X POST \
3027
-H "Accept: application/vnd.github+json" \
3128
-H "Authorization: Bearer $GH_TOKEN"\
3229
-H "X-GitHub-Api-Version: 2022-11-28" \
3330
https://api.github.com/repos/${{ github.repository }}/check-runs \
34-
-d '{"name":"Coverage ratio", "head_sha":"${{ github.event.pull_request.head.sha }}", "status":"completed", "conclusion":"success","output":{"title":"${{env.COVERAGE}}", "summary":""}}'
31+
-d '{"name":"Coverage ratio", "head_sha":"${{ github.event.pull_request.head.sha }}",\
32+
"status":"completed", "conclusion":"success",\
33+
"output":{"title":"${{env.COVERAGE}}", "summary":""}}'
34+

0 commit comments

Comments
 (0)