File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
actions/send-notification Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change 4
4
webhook-url:
5
5
description: 'Google Chat Webhook URL'
6
6
required: true
7
+ status:
8
+ description: 'Status of the job'
9
+ required: true
7
10
build-scan-url:
8
11
description: 'URL of the build scan to include in the notification'
9
12
run-name:
@@ -17,14 +20,14 @@ runs:
17
20
echo "BUILD_SCAN=${{ inputs.build-scan-url == '' && ' [build scan unavailable]' || format(' [<{0}|Build Scan>]', inputs.build-scan-url) }}" >> "$GITHUB_ENV"
18
21
echo "RUN_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" >> "$GITHUB_ENV"
19
22
- shell: bash
20
- if: ${{ success() }}
23
+ if: ${{ inputs.status == ' success' }}
21
24
run: |
22
25
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was successful ${{ env.BUILD_SCAN }}"}' || true
23
26
- shell: bash
24
- if: ${{ failure() }}
27
+ if: ${{ inputs.status == ' failure' }}
25
28
run: |
26
29
curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<users/all> *<${{ env.RUN_URL }}|${{ inputs.run-name }}> failed* ${{ env.BUILD_SCAN }}"}' || true
27
30
- shell: bash
28
- if: ${{ cancelled() }}
31
+ if: ${{ inputs.status == ' cancelled' }}
29
32
run: |
30
- curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancalled "}' || true
33
+ curl -X POST ${{ inputs.webhook-url }} -H 'Content-Type: application/json' -d '{ text: "<${{ env.RUN_URL }}|${{ inputs.run-name }}> was cancelled "}' || true
Original file line number Diff line number Diff line change 52
52
if: always()
53
53
with:
54
54
webhook-url: ${{ secrets.GOOGLE_CHAT_WEBHOOK_URL }}
55
+ status: ${{ job.status }}
55
56
build-scan-url: ${{ steps.build.outputs.build-scan-url }}
56
57
run-name: ${{ format('{0} | Windows | Java 17', github.ref_name) }}
You can’t perform that action at this time.
0 commit comments