Skip to content

Add social media auto-posting for blog posts, advisories & events#4278

Open
ewels wants to merge 3 commits into
mainfrom
social-auto-post
Open

Add social media auto-posting for blog posts, advisories & events#4278
ewels wants to merge 3 commits into
mainfrom
social-auto-post

Conversation

@ewels

@ewels ewels commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

Brings the website to parity with pipeline release announcements: automatically posts to Bluesky and Mastodon when:

  • a new blog post is published
  • a new advisory is published
  • an event is happening — the day before it starts, or the same day if it was only just published

This replaces the old blog-only Bluesky feedbot (blueskyfeedbot.yml), which is now superseded.

How it works

  • /social-feed.json — a new Astro endpoint built from the existing content collections (single source of truth; no frontmatter re-parsing or URL logic duplicated). Exposes recently published blog posts / advisories and upcoming events, with the header image for cards.
  • bin/social-post.js — fetches that feed, decides what's due, and posts to both networks:
    • Includes the subtitle in the post text.
    • Bluesky posts get a proper link-preview card (title + subtitle + header-image thumbnail) via an app.bsky.embed.external embed — the old RSS feedbot couldn't render cards over the API.
    • Per-network dedup log so nothing posts twice; a transient failure on one network never double-posts the other. Log entries auto-prune after 90 days.
  • .github/workflows/social-post.yml — hourly cron (fast for blog/advisory, catches the event day-before window) + manual dispatch with dry_run / seed toggles.

Dedup state

The record of what's already been posted is kept in the Actions cache (S3-backed via RunsOn) rather than committed to the repo. Each run restores the most recent log via the social-posts- key prefix and saves an updated copy under a fresh, unique key (cache entries are immutable, so nothing is overwritten). The workflow makes no repo writes (contents: read, no token push). It runs on a RunsOn runner with extras=s3-cache; the runs-on/action step is a no-op if ever run on a GitHub-hosted runner.

Before merging / rollout

  1. Add a MASTODON_ACCESS_TOKEN repo secret for @nf_core@mstdn.science (Bluesky reuses the existing FEED_TO_BLUESKY). Until it's set, Mastodon is skipped and Bluesky still works.
  2. After merge, run the workflow once with seed: true (a dry_run: true pass first is recommended) so the existing back-catalogue is marked as already-posted and not blasted out.

Notes

  • Event posts fire at 00:00 UTC the day before — happy to shift to a friendlier time of day if preferred.

Testing

  • End-to-end dry-run / seed / dedup verified against a mock feed (blog, advisory, day-before & day-of events all post; a future event correctly doesn't; seeded items are then suppressed).
  • Log pruning verified (entries >90 days are dropped).
  • Workflow passes zizmor; actions are SHA-pinned.

🤖 Generated with Claude Code

@netlify /social-feed.json.ts

Posts new blog posts and advisories, and upcoming events (the day before
or day of), to Bluesky and Mastodon — bringing the website to parity with
the pipeline release announcements.

- New `/social-feed.json` endpoint, built from the Astro content
  collections (single source of truth, no frontmatter re-parsing).
- `bin/social-post.js` posts to both networks. Bluesky posts get a proper
  link-preview card (title, subtitle, header image) via an external embed,
  which the old RSS feedbot could not produce. Includes the subtitle in
  the post text.
- Hourly scheduled workflow; per-network dedup log kept on a dedicated
  `social-bot-state` branch so it never triggers a production rebuild.
- Replaces the blog-only Bluesky feedbot, which is now superseded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploy Preview for nf-core-main-site ready!

Name Link
🔨 Latest commit bb9358f
🔍 Latest deploy log https://app.netlify.com/projects/nf-core-main-site/deploys/6a3a8a328c2eca0008107fbb
😎 Deploy Preview https://deploy-preview-4278--nf-core-main-site.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot deleted a comment from netlify Bot Jun 23, 2026
ewels and others added 2 commits June 23, 2026 15:13
Switch the post-tracking state from a committed `social-bot-state` branch
to the S3-backed Actions cache (RunsOn magic cache). Each run restores the
most recent log via the `social-posts-` key prefix and saves an updated
copy under a fresh, unique key — cache entries are immutable, so nothing
is overwritten.

This removes all repo writes from the workflow (contents: write -> read,
no GITHUB_TOKEN push) and the double remote fetch. Runs on a RunsOn runner
with `extras=s3-cache`; the `runs-on/action` step is a no-op on
GitHub-hosted runners.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant