Skip to content

feat(sync-docs): ref override for previewing branches#73

Merged
wavekat-eason merged 3 commits into
mainfrom
feat/sync-docs-ref-override
May 23, 2026
Merged

feat(sync-docs): ref override for previewing branches#73
wavekat-eason merged 3 commits into
mainfrom
feat/sync-docs-ref-override

Conversation

@wavekat-eason
Copy link
Copy Markdown
Contributor

Summary

  • Adds SYNC_DOCS_REF_<SLUG> env var support to scripts/sync-docs.js — when set, pins that source to the specified branch/tag/sha and skips the "latest tag → main" fallback (so typos fail loudly).
  • Exposes it on preview.yml via workflow_dispatch inputs voice_ref and cli_ref so you can preview an in-flight docs branch by triggering the workflow from the Actions UI without touching code.

How to use

  1. Go to Actions → Preview DeployRun workflow
  2. Pick the branch of wavekat.com to build (usually main)
  3. Fill voice_ref with e.g. feat/onboarding-v2 (and/or cli_ref)
  4. The preview deploys with that ref's docs

Leave inputs empty for the default tag-based behavior.

Notes

  • Override only applies when triggered via workflow_dispatch. Regular PR builds and prod releases use the default (latest tag).
  • A bad ref now errors the build (no silent main fallback when override is set) — matches the intent of "I explicitly want THIS ref."
  • release.yml doesn't get inputs — prod always tracks tags.

Test plan

  • Local: SYNC_DOCS=1 SYNC_DOCS_REF_VOICE=feat/onboarding-v2 SYNC_DOCS_TOKEN=... node scripts/sync-docs.js pins voice to that branch.
  • CI: workflow_dispatch with voice_ref=feat/onboarding-v2 produces a preview with the in-flight docs.

🤖 Generated with Claude Code

Add SYNC_DOCS_REF_<SLUG> env var (e.g. SYNC_DOCS_REF_VOICE) to pin a
source to a specific branch/tag/sha instead of the default "latest
tag, fallback to main" logic. When set, the override is the only ref
tried — no fallback — so typos fail loudly instead of silently
shipping main.

preview.yml exposes this via workflow_dispatch inputs voice_ref and
cli_ref so previewing in-flight docs branches (e.g. wavekat-voice's
feat/onboarding-v2) is a one-click action from the Actions UI.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented May 23, 2026

Deploying wavekat-com with  Cloudflare Pages  Cloudflare Pages

Latest commit: caa666d
Status: ✅  Deploy successful!
Preview URL: https://dcb97ef9.wavekat-com.pages.dev
Branch Preview URL: https://feat-sync-docs-ref-override.wavekat-com.pages.dev

View logs

- tryLocal now honors SYNC_DOCS_REF_<SLUG>, extracting docs from that
  ref via git archive against a local clone. Lets you preview an
  in-flight branch with WAVEKAT_LOCAL_REPOS without needing a token
  or going through CI.
- tryRemote now logs git's actual stderr (last 2 lines) and
  distinguishes "clone failed" from "clone ok but docsPath missing".
  No more silent "no docs found at any ref".
- Flatten slashes in ref names when building tmp dirs so refs like
  feat/onboarding-v2 don't create nested directories.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 23, 2026

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@wavekat-eason wavekat-eason merged commit 94eeadf into main May 23, 2026
2 checks passed
@wavekat-eason wavekat-eason deleted the feat/sync-docs-ref-override branch May 23, 2026 06:20
wavekat-eason pushed a commit that referenced this pull request May 23, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.0.25](wavekat-com-v0.0.24...wavekat-com-v0.0.25)
(2026-05-23)


### Features

* enable voice docs sync from wavekat-voice
([#70](#70))
([7353fa3](7353fa3))
* **sync-docs:** ref override for previewing branches
([#73](#73))
([94eeadf](94eeadf))


### Bug Fixes

* **ci:** unblock private docs sync from runner
([#72](#72))
([a82b0ee](a82b0ee))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.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