Skip to content

.github/workflows/run.yml #2527

.github/workflows/run.yml

.github/workflows/run.yml #2527

Workflow file for this run

# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions
on:
schedule:
# POSIX cron syntax (every 6 hours), https://crontab.guru/#0_*/6_*_*_*
- cron: "0 */6 * * *"
name: "Run"
jobs:
run-bot:
name: "Run the bot and post to Mastodon"
runs-on: ubuntu-latest
permissions:
contents: write
env:
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }}
MASTODON_INSTANCE: ${{ secrets.MASTODON_INSTANCE }}
steps:
- name: "Checkout sources"
uses: actions/checkout@v4
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.3"
coverage: none
extensions: curl, fileinfo, intl, json, mbstring, simplexml, sodium, zlib
- name: "Install dependencies with composer"
uses: ramsey/composer-install@v3
- name: "Run bot"
run: php ./cli/run.php
- name: "Commit log"
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: ":octocat: posted toot"
file_pattern: "data/posted.json"
commit_user_name: "github-actions[bot]"
commit_user_email: "41898282+github-actions[bot]@users.noreply.github.com"
commit_author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>"