From b3717c57f71c32a01c8dedc999dcf7df1afcfe70 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Wed, 2 Dec 2026 08:59:04 +0000 Subject: [PATCH 1/2] ci: copy the released README into the docs --- .github/workflows/publish.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a6270ac..400fb76 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -92,3 +92,53 @@ jobs: uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 with: packages-dir: release/dist/ + + docs: + needs: publish + if: github.event_name == 'release' || inputs.publish + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: read + concurrency: + group: reflag-docs-sync + cancel-in-progress: false + env: + RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name }} + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + ref: refs/tags/${{ env.RELEASE_TAG }} + fetch-depth: 0 + persist-credentials: false + path: sdk + - name: Checkout docs + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: reflagcom/docs + ssh-key: ${{ secrets.DOCS_DEPLOY_KEY }} + path: reflag-docs + - uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0 + with: + node-version: 24 + - name: Copy the released README into the docs + run: node reflag-docs/.github/scripts/sdk-readme.mjs sync --sdk python-sdk --source sdk --destination reflag-docs + - name: Check docs + working-directory: reflag-docs + run: node .github/scripts/check-sdk-docs.mjs + - name: Commit and push + working-directory: reflag-docs + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@reflag.com" + git add supported-languages .generated/sdk-readmes + if git diff --cached --quiet; then + echo "Docs already match $RELEASE_TAG." + exit 0 + fi + git commit -m "Update Python SDK documentation to $RELEASE_TAG" + for attempt in 1 2 3; do + git push && exit 0 + git pull --rebase + done + exit 1 From ce0b669bb119977f5119543a60253da06daf6fc0 Mon Sep 17 00:00:00 2001 From: Ron Cohen <744+roncohen@users.noreply.github.com> Date: Wed, 2 Dec 2026 10:06:30 +0000 Subject: [PATCH 2/2] ci: let the publish job gate the docs sync --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 400fb76..0a37cd5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -95,7 +95,6 @@ jobs: docs: needs: publish - if: github.event_name == 'release' || inputs.publish runs-on: ubuntu-latest timeout-minutes: 10 permissions: