Add GH Action to sync SDK READMEs from sensible-docs - #686
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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.github/workflows/sync-sdk-readmes.yml: triggers on push tov0when either SDK quickstart file changes (or onworkflow_dispatch); runs both syncs and fails the check until the SDK repo PRs are merged## SDK overviewheading to the top of bothpython-sdk-quickstart.mdandnode-sdk-quickstart.mdso the assembled READMEs are structurally correctOne-time setup required before merging
SDK_SYNC_TOKENsecret to this repo — a fine-grained PAT with Contents: Read & Write and Pull requests: Read & Write onsensible-hq/sensible-api-pyandsensible-hq/sensible-api-js## SDK overview:Test plan
SDK_SYNC_TOKENsecret is set on this repo<!-- SENSIBLE-DOCS-SYNC-START -->to both SDK READMEsworkflow_dispatchon this action and verify it opens PRs in both SDK reposv0, and confirm the action opens a new PR in the corresponding SDK repo and fails the check🤖 Generated with Claude Code