Skip to content

.github/workflows/run.yml #885

.github/workflows/run.yml

.github/workflows/run.yml #885

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_3,9,15,21_*_*_*
- cron: "0 3,9,15,21 * * *"
name: "Run"
jobs:
run-bot:
name: "Run the bot and post to Mastodon"
runs-on: ubuntu-latest
env:
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }}
MASTODON_INSTANCE: ${{ secrets.MASTODON_INSTANCE }}
steps:
- name: "Checkout sources"
uses: actions/checkout@v3
- name: "Install PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "8.2"
coverage: none
extensions: curl, json, mbstring, openssl, sodium
- name: "Install dependencies with composer"
uses: ramsey/composer-install@v2
- name: "Run bot"
run: php ./cli/run.php
- name: "Commit log"
uses: stefanzweifel/git-auto-commit-action@v4
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>"