Skip to content

Add GH Action to sync SDK READMEs from sensible-docs - #686

Merged
fscelliott merged 6 commits into
v0from
sync/sdk-readmes
Aug 24, 2026
Merged

Add GH Action to sync SDK READMEs from sensible-docs#686
fscelliott merged 6 commits into
v0from
sync/sdk-readmes

Conversation

@fscelliott

Copy link
Copy Markdown
Collaborator

Summary

  • Adds scripts/sdk_sync/sync_readme.py: fetches each SDK repo's README via the GitHub API, splits on a <!-- SENSIBLE-DOCS-SYNC-START --> HTML comment, replaces everything after it with the corresponding sensible-docs source file (frontmatter stripped), and opens or updates a PR in the SDK repo if the content differs
  • Adds .github/workflows/sync-sdk-readmes.yml: triggers on push to v0 when either SDK quickstart file changes (or on workflow_dispatch); runs both syncs and fails the check until the SDK repo PRs are merged
  • Adds ## SDK overview heading to the top of both python-sdk-quickstart.md and node-sdk-quickstart.md so the assembled READMEs are structurally correct

One-time setup required before merging

  1. Add SDK_SYNC_TOKEN secret to this repo — a fine-grained PAT with Contents: Read & Write and Pull requests: Read & Write on sensible-hq/sensible-api-py and sensible-hq/sensible-api-js
  2. Add the sync marker to each SDK repo's README just before ## SDK overview:
    <!-- SENSIBLE-DOCS-SYNC-START -->
    

Test plan

  • Confirm SDK_SYNC_TOKEN secret is set on this repo
  • Add <!-- SENSIBLE-DOCS-SYNC-START --> to both SDK READMEs
  • Trigger workflow_dispatch on this action and verify it opens PRs in both SDK repos
  • Merge the SDK PRs, re-run the action, and confirm it passes (no new PRs opened)
  • Edit one of the SDK quickstart source files, push to v0, and confirm the action opens a new PR in the corresponding SDK repo and fails the check

🤖 Generated with Claude Code

fscelliott and others added 6 commits August 24, 2026 15:46
- scripts/sdk_sync/sync_readme.py: fetches each SDK repo's README,
  splits on <!-- SENSIBLE-DOCS-SYNC-START --> comment, replaces
  everything after it with the sensible-docs source file, and opens
  or updates a PR in the SDK repo if the content differs
- .github/workflows/sync-sdk-readmes.yml: triggers on changes to
  the two SDK quickstart source files; fails until the SDK PRs merge
- adds ## SDK overview heading to both source files so the assembled
  READMEs are structurally correct

One-time setup: add <!-- SENSIBLE-DOCS-SYNC-START --> to each SDK
repo's README just before ## SDK overview, and add SDK_SYNC_TOKEN
secret (fine-grained PAT with contents+PR write on both SDK repos).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Drops the PR-creation approach (which required a cross-repo PAT) in
favour of a read-only check against the public raw.githubusercontent.com
URLs. The action now fails with clear fix instructions when the SDK
READMEs drift from the sensible-docs source files.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Those files are owned by a separate PR; they don't belong here.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The action checks for drift, it doesn't do the syncing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…dme.py

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@fscelliott
fscelliott merged commit 3595a6e into v0 Aug 24, 2026
@fscelliott
fscelliott deleted the sync/sdk-readmes branch August 24, 2026 22:08
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