{
  "id": 20225244,
  "title": "Automating Bluesky JSON Payload Generation for Content‑Automation",
  "url": "https://urgent.news/2026/11/15/automating-bluesky-json-payload-generation-for-content-automation",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-15T20:01:33.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/zaerohell/automating-bluesky-json-payload-generation-for-content-automation-1fdi"
  },
  "original_language": "en",
  "account": "Automating Bluesky JSON Payload Generation for Content-Automation\n\nTL;DR: The author fixed the bug causing Bluesky JSON payload generation to fail, integrating the fix into the daily content-automation pipeline. The update ensures the payload schema is correct, includes proper date handling, and syncs metadata flags for seamless publishing to Bluesky without manual intervention.\n\nProblem: The content-automation repository was publishing articles to Medium, Substack, and Bluesky daily. While Medium and Substack pipelines worked fine, the Bluesky step consistently failed with an error in CI logs: \"JSON validation failed – property date is required.\" The bluesky_es.json file was either missing or incomplete, leaving the bluesky_published flag untouched in metadata.json. This meant the article never appeared on Bluesky.\n\nAttempts: Initially, I attempted a quick-fix by manually setting the date field in the generated JSON file after the script ran. This resolved the validation error temporarily but led to a brittle workaround that failed when schema changes occurred. The original generateBlueskyPayload() function assumed the presence of a summary field, which was optional in markdown front-matter. When summary was missing, it returned undefined for the text property, causing validation errors due to undefined values.\n\nImplementation:\n1. Refactored the payload builder: I modified generateBlueskyPayload() to use mdMeta.excerpt as a fallback for the text property and provided a default string when neither summary nor excerpt were available. This ensured text was always defined, eliminating undefined values that caused validation failures.\n2. Updated the JSON schema validator: The validator was expanded to require type, text, date, and language fields. This ensured the JSON payload adhered to the expected structure, allowing the script to fail fast and provide clear error messages if any required field was missing.\n3. Integrated the generator into the daily run: I added a new step in the GitHub Actions workflow that runs the Bluesky generator after Medium and Substack publishing steps. The step generates the payload JSON, commits it to the repository, and updates metadata.json to indicate that Bluesky generation has occurred.\n4. Synced metadata flags: I added a bluesky_generated boolean to metadata.json, which is set to true after the JSON file is written. This ensured that the bluesky_published flag in metadata.json accurately reflected the status of Bluesky posts.\n5. Verified the changes: I committed the relevant diffs, confirming that the fixes addressed the root cause of the Bluesky JSON generation issue and integrated smoothly into the existing daily content-automation pipeline.\n\nThe implementation resolved the Bluesky JSON generation bug, ensuring that articles now publish correctly to Bluesky without requiring manual intervention.",
  "summary": "Automating Bluesky JSON Payload Generation for Content‑Automation TL;DR: I fixed the bug that prevented the automatic creation of the Bluesky JSON payload and wired it into our daily content‑automation pipeline. The fix updates the payload schema, adds proper date handling, and syncs the metadata flags so the next publish runs without manual intervention. The Problem Our content‑automation repo…",
  "key_points": [
    "Refactored generateBlueskyPayload() to use mdMeta.excerpt as fallback for text property",
    "Updated JSON schema validator to require type, text, date, and language fields",
    "Integrated Bluesky generator into daily GitHub Actions workflow for seamless publishing"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}