Fetch latest articles and toot about them #1366
This file contains hidden or 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 latest articles and toot about them | |
| on: | |
| push: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '30 08 * * *' | |
| jobs: | |
| scheduled: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out this repo | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4.3.0 | |
| with: | |
| python-version: "3.10" | |
| - name: Install Python dependencies | |
| run: |- | |
| python3 -m pip install Mastodon.py requests | |
| - name: Run script | |
| env: | |
| MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} | |
| EMAIL: raf.guns@uantwerpen.be | |
| run: |- | |
| python3 qss-paper-bot.py | |
| - name: Commit and push if it changed | |
| run: |- | |
| git config user.name "Automated" | |
| git config user.email "actions@users.noreply.github.com" | |
| git add tooted-dois.txt | |
| timestamp=$(date -u) | |
| git commit -m "Add new DOIs" || exit 0 | |
| git push |