Skip to content

Commit 174624d

Browse files
committed
Report error status
1 parent 5526299 commit 174624d

File tree

1 file changed

+29
-1
lines changed

1 file changed

+29
-1
lines changed

.github/workflows/jest.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,32 @@ jobs:
3030

3131
# Finally, run our tests
3232
- name: Run the tests
33-
run: npm test
33+
run: npm test
34+
35+
- name: Tests ✅
36+
if: ${{ success() }}
37+
run: |
38+
curl --request POST \
39+
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
40+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
41+
--header 'content-type: application/json' \
42+
--data '{
43+
"context": "tests",
44+
"state": "success",
45+
"description": "Tests passed",
46+
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
47+
}'
48+
49+
- name: Tests 🚨
50+
if: ${{ failure() }}
51+
run: |
52+
curl --request POST \
53+
--url https://api.github.com/repos/${{ github.repository }}/statuses/${{ github.sha }} \
54+
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
55+
--header 'content-type: application/json' \
56+
--data '{
57+
"context": "tests",
58+
"state": "failure",
59+
"description": "Tests failed",
60+
"target_url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
61+
}'

0 commit comments

Comments
 (0)