diff --git a/.github/workflows/blog-publish.yml b/.github/workflows/blog-publish.yml index c03ff71..e61837a 100644 --- a/.github/workflows/blog-publish.yml +++ b/.github/workflows/blog-publish.yml @@ -57,6 +57,9 @@ jobs: ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} MICROBLOG_APP_TOKEN: ${{ secrets.MICROBLOG_APP_TOKEN }} MICROBLOG_DESTINATION_UID: ${{ vars.MICROBLOG_DESTINATION_UID }} + # Comma-separated UIDs from GET /micropub?q=syndicate-to (linkedin, mastodon, bluesky, threads). + # Defaults to 'linkedin' if the repo variable is unset. + MICROBLOG_SYNDICATE_TO: ${{ vars.MICROBLOG_SYNDICATE_TO || 'linkedin' }} POST_PATH: ${{ steps.post.outputs.path }} BASE_URL: https://doughatcher.com run: node apps/editorial-loop/publish.js diff --git a/apps/editorial-loop/lib/microblog-poster.js b/apps/editorial-loop/lib/microblog-poster.js index 46c87d1..7f3a802 100644 --- a/apps/editorial-loop/lib/microblog-poster.js +++ b/apps/editorial-loop/lib/microblog-poster.js @@ -76,6 +76,17 @@ export async function postToMicroblog(text) { if (process.env.MICROBLOG_DESTINATION_UID) { params.append('mp-destination', process.env.MICROBLOG_DESTINATION_UID); } + // micro.blog requires per-post opt-in for syndication — it does NOT honor + // the account-level cross-post default for API-posted entries. Pass each + // destination UID as a separate mp-syndicate-to[] form field. + // Discover UIDs at GET /micropub?q=syndicate-to (e.g. "linkedin", "mastodon"). + const syndicateTo = (process.env.MICROBLOG_SYNDICATE_TO || '') + .split(',') + .map(s => s.trim()) + .filter(Boolean); + for (const uid of syndicateTo) { + params.append('mp-syndicate-to[]', uid); + } const res = await fetch('https://micro.blog/micropub', { method: 'POST',