Run the bot #18490
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: Run the bot | |
on: | |
workflow_dispatch: | |
push: | |
schedule: | |
- cron: "0 * * * *" | |
jobs: | |
scheduled: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: "pip" | |
- name: Install requirements | |
run: pip install -r requirements.txt | |
- name: Run script | |
env: | |
MASTODON_INSTANCE: ${{ vars.MASTODON_INSTANCE }} | |
MASTODON_USER: ${{ vars.MASTODON_USER }} | |
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }} | |
run: python best_of_mltshp.py | |
- name: Update links | |
run: |- | |
git config user.name "Automated" | |
git config user.email "[email protected]" | |
git add links.log | |
timestamp=$(date -u) | |
git commit -m "Updated links: ${timestamp}" || exit 0 | |
git push |