forked from persian-calendar/persian-calendar
-
Notifications
You must be signed in to change notification settings - Fork 2
35 lines (34 loc) · 1.29 KB
/
notify-build-status.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
on:
workflow_run:
workflows: [Android CI]
types: [completed]
branches: [main]
jobs:
on-success:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: Unpin failure message
run: |
curl -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/pinChatMessage \
-d disable_notification=false \
-d message_id=3716 \
-d chat_id=${{ secrets.TELEGRAM_CHAT_ID }}
sleep 1
curl -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/unpinChatMessage \
-d message_id=3716 \
-d chat_id=${{ secrets.TELEGRAM_CHAT_ID }}
on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'failure' }}
steps:
- name: Notify about the build failure
run: |
curl -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/pinChatMessage \
-d disable_notification=false \
-d message_id=3715 \
-d chat_id=${{ secrets.TELEGRAM_CHAT_ID }}
sleep 1
curl -X POST https://api.telegram.org/bot${{ secrets.TELEGRAM_TOKEN }}/unpinChatMessage \
-d message_id=3715 \
-d chat_id=${{ secrets.TELEGRAM_CHAT_ID }}