New note. #71
This file contains 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: 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 }} |