Files
LangBot/.github/workflows/sync-landing-submodule.yml
T
9b3bb30445 fix(ci): fall back to the existing repo PAT for docs publication
The migrated workflows required LANGBOT_WIKI_PUSH_TOKEN, which only exists in
the langbot-docs repository. The existing RELEASE_UPLOAD_GITHUB_TOKEN was
verified to authenticate as the owner with repo scope plus push/admin on
LangBot, langbot-docs, langbot-landing-page and the production fork, and it can
push the Wiki, so publication now falls back to it when the dedicated secret is
absent. Also retarget the cutover notes at the master branch.

Co-Authored-By: Mika (Multica) <[email protected]>
Co-authored-by: multica-agent <[email protected]>
2026-10-27 08:22:16 +00:00

45 lines
1.5 KiB
YAML

name: Sync docs mirror and landing submodule
on:
push:
branches: [master]
paths: ['docs/**', '.github/workflows/sync-landing-submodule.yml']
workflow_dispatch:
permissions:
contents: read
concurrency:
group: sync-landing-docs-main
cancel-in-progress: false
jobs:
sync:
if: github.repository == 'langbot-app/LangBot' && github.ref == 'refs/heads/master' && vars.DOCS_MIRROR_ENABLED == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
with:
ref: master
fetch-depth: 0
persist-credentials: false
- name: Test synchronization contracts
working-directory: docs
run: python3 -m unittest discover -s tests -p test_sync_landing_submodule.py -v
- name: Publish docs subtree (fast-forward only)
env:
GH_TOKEN: ${{ secrets.LANGBOT_WIKI_PUSH_TOKEN || secrets.RELEASE_UPLOAD_GITHUB_TOKEN }}
run: |
gh auth setup-git
git remote add docs-mirror https://github.com/langbot-app/langbot-docs.git
git fetch docs-mirror main
docs_sha=$(git subtree split --prefix=docs)
git merge-base --is-ancestor docs-mirror/main "$docs_sha"
git push docs-mirror "$docs_sha:refs/heads/main"
- name: Update landing submodule and production fork
working-directory: docs
env:
GH_TOKEN: ${{ secrets.LANGBOT_WIKI_PUSH_TOKEN || secrets.RELEASE_UPLOAD_GITHUB_TOKEN }}
run: python3 scripts/sync-landing-submodule.py