Skip to content

Commit e54bba8

Browse files
authored
TestRail backup: Notify only if the job fails (#238)
1 parent 556b15e commit e54bba8

File tree

3 files changed

+4
-40
lines changed

3 files changed

+4
-40
lines changed

.github/workflows/testrail-backup.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -96,26 +96,11 @@ jobs:
9696
uses: slackapi/slack-github-action@v2.1.1
9797
if: ${{ failure() }}
9898
with:
99+
method: chat.postMessage
100+
token: ${{ secrets.SLACK_BOT_TOKEN }}
99101
payload-file-path: ${{ env.DEFAULT_DIR }}/slack-fail.json
100-
payload-templated: true
101-
webhook: ${{ secrets.SLACK_WEBHOOK_URL_TEST_ALERTS_SANDBOX }}
102-
webhook-type: incoming-webhook
102+
payload-templated: true
103103
env:
104-
server_url: ${{ github.server_url }}
105-
repository: ${{ github.repository }}
106-
run_id: ${{ github.run_id }}
107-
branch: ${{ github.ref_name }}
108-
109-
- name: Notify Slack (Success)
110-
uses: slackapi/slack-github-action@v2.1.1
111-
if: ${{ success() }}
112-
with:
113-
payload-file-path: ${{ env.DEFAULT_DIR }}/slack-success.json
114-
payload-templated: true
115-
webhook: ${{ secrets.SLACK_WEBHOOK_URL_TEST_ALERTS_SANDBOX }}
116-
webhook-type: incoming-webhook
117-
env:
118-
uploaded: ${{ steps.upload-file.outputs.uploaded }}
119104
server_url: ${{ github.server_url }}
120105
repository: ${{ github.repository }}
121106
run_id: ${{ github.run_id }}

backup-tools/slack-fail.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"channel": "${{ secrets.SLACK_MOBILE_TOOLING_CHANNEL_ID }}",
23
"blocks": [
34
{
45
"type": "header",

backup-tools/slack-success.json

Lines changed: 0 additions & 22 deletions
This file was deleted.

0 commit comments

Comments
 (0)