GitHub Action (signed release webhook) · Mastodon

A GitHub Actions Mastodon bot that asks first

Many open-source maintainers keep a project account on Mastodon, and release posts are what followers expect from it. socialhandoff-announce-action sends each GitHub release to SocialHandoff, which drafts a toot from the tag, name, and notes. The draft carries a citation to the release, and a maintainer approves it before it federates. You review each post in the inbox before it reaches your followers.

Prompt

Workflow: on release published, run socialhandoff-announce-action with the three repository secrets. Release rule in Connections targets mastodon only, with approval required. Maintainers review the draft in the inbox and add a CW if the notes are long.

How to do it

  1. Connect Mastodon and add a release rule In https://app.socialhandoff.com, connect Mastodon, then add a GitHub trigger in Connections with a release rule that targets Mastodon. Copy the trigger id and signing secret.
  2. Store the secrets Add your instance URL, the trigger id, and the signing secret as repository secrets.
  3. Add the workflow Create a workflow on: release with types [published] that runs socialhandoff-announce-action. The action signs the payload with HMAC-SHA256 and sends tag, name, notes, and URL.
  4. Approve the draft Publish a release. A Mastodon draft appears in the inbox with a citation back to the release, and publishes only after you approve it.

Example draft

Released: linthaus 0.14.0

New rule: no-unused-imports, with an autofix. The config loader now accepts linthaus.config.ts. Plus 11 bug fixes from 6 contributors.

Full notes: github.com/acme/linthaus/releases/tag/v0.14.0

#JavaScript #OpenSource

Gotchas

  • Use CamelCase hashtags such as #OpenSource so screen readers say them correctly, and a content warning for long logs or spoilers.
  • 500 characters is only the default. Many instances allow more or less, so set the per-network length guardrail to your server's real limit.
  • Publishing uses idempotency keys, so a retried request after a timeout does not produce a duplicate toot.
  • The action sends the release, not a finished post. Mastodon as a target and the approval rule live on the release rule in Connections, not in the workflow file.
Mastodon
  • Character limit: 500 characters on a default Mastodon server. Each instance can raise it, so check yours.
  • Links: Every URL counts as 23 characters, however long it is.
  • Media per post: Up to 4 attachments on a default server.
  • File sizes: Images up to 16 MB and video up to about 99 MB on a default install. Instances can set their own limits.
Mastodon scheduler with approval for any instance

Frequently asked questions

Does the action need an agent key?
No. It uses the trigger id and a signing secret, and the request is verified with HMAC-SHA256. The draft is attributed to the release in the audit log.
Will a re-run workflow post the release twice to Mastodon?
Duplicate protection covers the publish step, and every draft still needs approval, so a re-run shows up as a second draft you can reject.
Can I post to several fediverse accounts at once?
Yes. Connect each Mastodon account, and a single draft can target several. Each target is published and retried on its own.

Let your agents post. Keep the final say.

Connect your first agent in minutes. Every draft waits in your inbox until you approve it.

14 days free. No card required.

The hosted version is opening soon

Leave your email and we will send one message when hosted accounts open, with your 14-day trial ready. Want it today? Self-host it free from the repo.

Start free trial