telegram-crawler/.github/workflows/make_and_send_alert.yml

35 lines
800 B
YAML
Raw Normal View History

2021-04-25 17:05:57 +02:00
name: Send alert to Telegram channel
on:
push:
branches:
2021-04-25 18:00:32 +02:00
- main
2021-04-25 17:05:57 +02:00
jobs:
make_and_send_alert:
name: Send alert
runs-on: macos-10.15
steps:
- name: Clone.
uses: actions/checkout@v2
- name: Setup Python.
uses: actions/setup-python@v2
with:
python-version: 3.9
2021-04-25 18:51:46 +02:00
- name: Output head commit author
2021-04-25 17:05:57 +02:00
run: |
2021-04-25 18:51:46 +02:00
echo "${{ github.event.head_commit.author }}"
2021-04-25 17:05:57 +02:00
2021-04-25 18:51:46 +02:00
- name: Install dependencies and send alert to Telegram channel.
2021-04-25 18:41:37 +02:00
if: ${{ github.event.head_commit.author == 'GitHub Action' }}
2021-04-25 17:05:57 +02:00
env:
COMMIT_SHA: ${{ github.sha }}
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
run: |
2021-04-25 18:51:46 +02:00
pip install -r requirements.txt
2021-04-25 17:05:57 +02:00
python make_and_send_alert.py