AIUB Notice Checker #142
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |