Skip to content

Commit 2eeff96

Browse files
committed
[skip ci] Fix Slack notification
ravsamhq/notify-slack-action doesn't work on MacOS, so we use curl directly.
1 parent 4b22c3e commit 2eeff96

File tree

3 files changed

+13
-17
lines changed

3 files changed

+13
-17
lines changed

.github/actions/apt-x32/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ runs:
1313
apt-get install -y \
1414
autoconf \
1515
bison \
16+
curl \
1617
g++-multilib \
1718
gcc-multilib \
1819
language-pack-de \

.github/actions/notify-slack/action.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,6 @@ inputs:
55
runs:
66
using: composite
77
steps:
8-
- name: Notify Slack
9-
if: always()
10-
uses: ravsamhq/notify-slack-action@v1
11-
with:
12-
status: ${{ job.status }}
13-
notify_when: 'failure'
14-
env:
15-
SLACK_WEBHOOK_URL: ${{ inputs.token }}
8+
- shell: bash
9+
run: >-
10+
curl -X POST -H 'Content-type: application/json' --data '{"attachments": [{"text": "Job in *nightly* failed", "footer": "<https://github.com/php/php-src/actions/runs/${{ github.run_id }}|View Run>", "color": "danger", "mrkdwn_in": ["text"]}]}' ${{ inputs.token }}

.github/workflows/nightly.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
id: set-matrix
3232
run: php .github/nightly_matrix.php "${{ github.event_name }}" "${{ github.run_attempt }}"
3333
- name: Notify Slack
34-
if: always()
34+
if: failure()
3535
uses: ./.github/actions/notify-slack
3636
with:
3737
token: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -110,7 +110,7 @@ jobs:
110110
- name: Verify generated files are up to date
111111
uses: ./.github/actions/verify-generated-files
112112
- name: Notify Slack
113-
if: always()
113+
if: failure()
114114
uses: ./.github/actions/notify-slack
115115
with:
116116
token: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -186,7 +186,7 @@ jobs:
186186
-d opcache.jit_buffer_size=16M
187187
-d opcache.jit=1205
188188
- name: Notify Slack
189-
if: always()
189+
if: failure()
190190
uses: ./.github/actions/notify-slack
191191
with:
192192
token: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -249,7 +249,7 @@ jobs:
249249
- name: Verify generated files are up to date
250250
uses: ./.github/actions/verify-generated-files
251251
- name: Notify Slack
252-
if: always()
252+
if: failure()
253253
uses: ./.github/actions/notify-slack
254254
with:
255255
token: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -288,7 +288,7 @@ jobs:
288288
if: always()
289289
run: bash <(curl -s https://codecov.io/bash)
290290
- name: Notify Slack
291-
if: always()
291+
if: failure()
292292
uses: ./.github/actions/notify-slack
293293
with:
294294
token: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -408,7 +408,7 @@ jobs:
408408
exit 1
409409
fi
410410
- name: Notify Slack
411-
if: always()
411+
if: failure()
412412
uses: ./.github/actions/notify-slack
413413
with:
414414
token: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -484,7 +484,7 @@ jobs:
484484
- name: Verify generated files are up to date
485485
uses: ./.github/actions/verify-generated-files
486486
- name: Notify Slack
487-
if: always()
487+
if: failure()
488488
uses: ./.github/actions/notify-slack
489489
with:
490490
token: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -581,7 +581,7 @@ jobs:
581581
- name: Verify generated files are up to date
582582
uses: ./.github/actions/verify-generated-files
583583
- name: Notify Slack
584-
if: always()
584+
if: failure()
585585
uses: ./.github/actions/notify-slack
586586
with:
587587
token: ${{ secrets.ACTION_MONITORING_SLACK }}
@@ -641,7 +641,7 @@ jobs:
641641
- name: Verify generated files are up to date
642642
uses: ./.github/actions/verify-generated-files
643643
- name: Notify Slack
644-
if: always()
644+
if: failure()
645645
uses: ./.github/actions/notify-slack
646646
with:
647647
token: ${{ secrets.ACTION_MONITORING_SLACK }}

0 commit comments

Comments
 (0)