mastodon-notify.yml

 1name: Announce Release on Fosstodon
 2
 3on:
 4  release:
 5    types: [published]
 6
 7jobs:
 8  post-to-fosstodon:
 9    runs-on: ubuntu-latest
10    steps:
11      - name: Send Post to Fosstodon
12        env:
13          MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} 
14          MESSAGE: |
15            Release ${{ github.event.release.tag_name }} of Matcha is out!
16            Check it out! ${{ github.event.release.html_url }}
17        run: |
18          JSON_PAYLOAD=$(jq -n --arg status "$MESSAGE" '{status: $status}')
19          
20          curl -sS -X POST "https://fosstodon.org/api/v1/statuses" \
21            -H "Authorization: Bearer $MASTODON_ACCESS_TOKEN" \
22            -H "Content-Type: application/json" \
23            -d "$JSON_PAYLOAD"