-
-
Notifications
You must be signed in to change notification settings - Fork 15
62 lines (52 loc) · 1.54 KB
/
Copy pathexample.yml
File metadata and controls
62 lines (52 loc) · 1.54 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: Example Telert Workflow
on:
workflow_dispatch:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install telert
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
- name: Install dependencies
run: |
if [ -f requirements.txt ]; then
pip install -r requirements.txt
fi
- name: Send notification using telert
run: |
if [ -n "${{ secrets.TELERT_TOKEN }}" ]; then
telert config set-defaults --providers "telegram"
telert send "Workflow started: Example Telert Workflow"
else
echo "Secret TELERT_TOKEN not set. Skipping notification."
fi
env:
TELERT_TELEGRAM_TOKEN: ${{ secrets.TELERT_TOKEN }}
TELERT_TELEGRAM_CHAT_ID: ${{ secrets.TELERT_CHAT_ID }}
- name: Run tests
run: |
python -m pytest || true
- name: Build package
run: |
python -m build
- name: Send completion notification
run: |
if [ -n "${{ secrets.TELERT_TOKEN }}" ]; then
telert send "✅ Workflow completed: Example Telert Workflow"
else
echo "Secret TELERT_TOKEN not set. Skipping notification."
fi
env:
TELERT_TELEGRAM_TOKEN: ${{ secrets.TELERT_TOKEN }}
TELERT_TELEGRAM_CHAT_ID: ${{ secrets.TELERT_CHAT_ID }}