-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.18 KB
/
aiub-notice-checker.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
36
37
38
39
40
41
42
name: AIUB Notice Checker
on:
schedule:
- cron: '*/5 * * * *'
jobs:
check-notices:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v3
-
name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.7'
-
name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
-
name: Run script
env:
TELEGRAM_BOT_API_KEY: ${{ secrets.TELEGRAM_BOT_API_KEY }}
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
run: python main.py
-
name: Push changes to repository
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
if [[ $(git status) == *"nothing to commit, working tree clean"* ]]; then
exit 0
fi
git config user.name "GitHub Actions"
git config user.email "[email protected]"
git remote set-url origin https://${{ secrets.GITHUB_TOKEN }}@github.com/origamiofficial/aiub-notice-checker.git
git add aiub_notices.db
git commit -m "Notices Updated"
git push