-
-
Notifications
You must be signed in to change notification settings - Fork 3
33 lines (33 loc) · 1.04 KB
/
syndicate-to-mastodon.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
name: Syndicate to Mastodon
on:
push:
branches:
- 'main'
paths:
- 'content/notes/*.json'
- 'content/links/*.json'
jobs:
get-added-files:
runs-on: ubuntu-latest
outputs:
documents: ${{ steps.added-documents.outputs.documents }}
steps:
- name: checkout
uses: actions/checkout@main
with:
fetch-depth: 2
- name: Get added documents
id: added-documents
run: echo "documents=$(git diff --name-only --diff-filter=A ${{ github.sha }}{^,} | grep -e ^content/notes/ -e ^content/links/ | xargs)" > $GITHUB_OUTPUT
syndicate-to-mastodon:
needs: get-added-files
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@main
- name: use node 22
uses: actions/setup-node@v3
with:
node-version: 22.x
- name: Dispatch mastodon API call
run: node scripts/syndicate-to-mastodon.js --base-url ${{ secrets.MASTODON_BASE_URL }} --access-token ${{ secrets.MASTODON_ACCESS_TOKEN }} ${{ needs.get-added-files.outputs.documents }}