Skip to content

Commit 30e99d7

Browse files
committed
Post to slack only on run failure.
1 parent 180f2a5 commit 30e99d7

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

.github/workflows/serverless-vuln-scan.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@ on:
44
schedule:
55
# daily at midnight
66
- cron: "0 0 * * *"
7+
pull_request:
78

89
env:
910
VERSION: 1 # env var required when building extension
1011

1112
jobs:
12-
run:
13+
check:
1314
runs-on: ubuntu-latest
1415
steps:
16+
- name: Fails
17+
run: |
18+
set -e
19+
false
20+
1521
- name: Checkout datadog-agent repository
1622
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
1723
with:
@@ -108,3 +114,18 @@ jobs:
108114
fail-build: true
109115
severity-cutoff: low
110116
output-format: table
117+
118+
notify:
119+
needs: check
120+
if: failure()
121+
runs-on: ubuntu-latest
122+
steps:
123+
- name: Notify
124+
env:
125+
SLACK_CHANNEL: "#serverless"
126+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
127+
run: |
128+
set -x
129+
curl -H "Content-type: application/json" -X POST "$SLACK_WEBHOOK" -d '{
130+
"text": "this message from rey is just a test!"
131+
}'

0 commit comments

Comments
 (0)