Skip to content

AIUB Notice Checker #75021

AIUB Notice Checker

AIUB Notice Checker #75021

name: AIUB Notice Checker
on:
workflow_dispatch:
schedule:
- cron: '*/5 * * * *'
jobs:
check-notices:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
-
name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
check-latest: true
-
name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
-
name: Run script
env:
TELEGRAM_CHAT_ID: ${{ secrets.TELEGRAM_CHAT_ID }}
TELEGRAM_ADMIN_CHAT_ID: ${{ secrets.TELEGRAM_ADMIN_CHAT_ID }}
TELEGRAM_BOT_API_KEY: ${{ secrets.TELEGRAM_BOT_API_KEY }}
GITHUB_RUN_NUMBER: ${{ github.run_number }}
run: python main.py
-
name: Commit files
run: |
if [[ $(git status) == *"nothing to commit, working tree clean"* ]]; then
exit 0
fi
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git commit -a -m "Notices Updated"
-
name: Push changes to repository
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true