Skip to content

Commit 9602eb0

Browse files
authored
Update testrail-api-tests to only notify on failure and update appearance (#237)
1 parent 37554e9 commit 9602eb0

File tree

1 file changed

+44
-15
lines changed

1 file changed

+44
-15
lines changed

.github/workflows/testrail-api-tests.yml

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,48 @@ jobs:
4747
webhook-type: incoming-webhook
4848
payload: |
4949
{
50-
"type": "mrkdwn",
51-
"text": "TestRail API tests failed! :tada:\n\n*Workflow:* ${{ github.workflow }}\n*Job:* ${{ github.job }}\n\n*Status:* ${{ job.status }}\n*Test results:* Failed\n\nLink to results: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View results>"
52-
}
53-
54-
- name: Send Slack message on test success
55-
if: ${{ success() }}
56-
id: slack-success
57-
uses: slackapi/slack-github-action@v2.1.1
58-
with:
59-
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
60-
webhook-type: incoming-webhook
61-
payload: |
62-
{
63-
"type": "mrkdwn",
64-
"text": "TestRail API tests passed! :tada:\n\n*Workflow:* ${{ github.workflow }}\n*Branch:* ${{ github.ref_name }}\n*Job:* ${{ github.job }}\n\n*Status:* ${{ job.status }}\n*Test results:* Passed\n\nLink to results: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View results>"
50+
"text": "TestRail API tests failed!",
51+
"attachments": [
52+
{
53+
"color": "danger",
54+
"blocks": [
55+
{
56+
"type": "header",
57+
"text": {
58+
"type": "plain_text",
59+
"text": "TestRail API Tests Failed",
60+
"emoji": true
61+
}
62+
},
63+
{
64+
"type": "section",
65+
"fields": [
66+
{
67+
"type": "mrkdwn",
68+
"text": "*Workflow:*\n${{ github.workflow }}"
69+
},
70+
{
71+
"type": "mrkdwn",
72+
"text": "*Job:*\n${{ github.job }}"
73+
},
74+
{
75+
"type": "mrkdwn",
76+
"text": "*Status:*\n${{ job.status }}"
77+
},
78+
{
79+
"type": "mrkdwn",
80+
"text": "*Test Results:*\nFailed"
81+
}
82+
]
83+
},
84+
{
85+
"type": "section",
86+
"text": {
87+
"type": "mrkdwn",
88+
"text": "<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Results>"
89+
}
90+
}
91+
]
92+
}
93+
]
6594
}

0 commit comments

Comments
 (0)