Fetch Mastodon Statuses #16747
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: Fetch Mastodon Statuses | |
on: | |
push: | |
branches: | |
- main | |
schedule: | |
- cron: '*/5 * * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
- name: Install dependencies | |
run: pip install requests | |
- name: Fetch Mastodon statuses and generate memos | |
env: | |
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} | |
MASTODON_USERNAME: ${{ secrets.MASTODON_USERNAME }} | |
run: | | |
python fetch_mastodon_status.py | |
python generate_memos.py | |
- name: Commit and push status.json and memos.json | |
run: | | |
git config --global user.name 'github-actions' | |
git config --global user.email 'github-actions@github.com' | |
git add status.json memos.json last_fetched_id.txt img/ | |
git commit -m 'Update status.json, memos.json, and images' | |
git push | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |