Skip to content

Commit 322c2bb

Browse files
committed
Send emails on failure
1 parent 0b115fe commit 322c2bb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

.github/workflows/npmpublish.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,18 @@ jobs:
1515
- run: npm i
1616
- run: npm run build
1717
- run: npm test
18+
- name: Send mail on fail
19+
uses: dawidd6/action-send-mail@v2
20+
if: ${{ failure() }}
21+
with:
22+
server_address: smtp.gmail.com
23+
server_port: 465
24+
username: ${{secrets.MAIL_USERNAME}}
25+
password: ${{secrets.MAIL_PASSWORD}}
26+
subject: Github Actions job result
27+
body: Test job of ${{github.repository}} failed!
28+
to: ${{secrets.MAIL_TARGET}}
29+
from: Github Actions
1830

1931
publish-npm:
2032
needs: build
@@ -30,3 +42,15 @@ jobs:
3042
- run: npm publish
3143
env:
3244
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
45+
- name: Send mail on fail
46+
uses: dawidd6/action-send-mail@v2
47+
if: ${{ failure() }}
48+
with:
49+
server_address: smtp.gmail.com
50+
server_port: 465
51+
username: ${{secrets.MAIL_USERNAME}}
52+
password: ${{secrets.MAIL_PASSWORD}}
53+
subject: Github Actions job result
54+
body: Publish job of ${{github.repository}} failed!
55+
to: ${{secrets.MAIL_TARGET}}
56+
from: Github Actions

0 commit comments

Comments
 (0)