forked from php-tootbot/tootbot-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
48 lines (36 loc) · 1.32 KB
/
run.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# 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>"