From c9db378ae5a8fec8df6780f28b2ca01a9f5cb321 Mon Sep 17 00:00:00 2001 From: infinityplusone Date: Fri, 15 May 2026 15:06:57 -0400 Subject: [PATCH 1/2] ci: add docs-dispatch workflow Pings makegov/docs (the editorial composer) via repository_dispatch when docs/, README.md, CHANGELOG.md, or crates/*/src/** changes on main. docs.makegov.com rebuilds the Rust SDK pages from this repo's docs/. Requires the DOCS_DISPATCH_TOKEN repo secret with contents:write on makegov/docs. Co-Authored-By: Claude Opus 4.7 --- .github/workflows/docs-dispatch.yml | 59 +++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 .github/workflows/docs-dispatch.yml diff --git a/.github/workflows/docs-dispatch.yml b/.github/workflows/docs-dispatch.yml new file mode 100644 index 0000000..202fe5f --- /dev/null +++ b/.github/workflows/docs-dispatch.yml @@ -0,0 +1,59 @@ +name: Docs dispatch + +# Fires on push to main when content that affects the published docs site +# changes (docs/, README, CHANGELOG, or the public source of any workspace +# crate). Notifies makegov/docs via repository_dispatch so the docs site +# rebuilds without waiting for someone to push to the composer. +# +# tango-rust is a `coloc-source` repo: its docs/ folder is the authoritative +# source for the Rust SDK pages on docs.makegov.com. +# +# Required secrets: +# DOCS_DISPATCH_TOKEN — GitHub token with contents:write on makegov/docs. +# +# Required variables (optional): +# DOCS_TARGET_REPO — override the dispatch target (default: makegov/docs). + +on: + push: + branches: + - main + paths: + - "docs/**" + - "README.md" + - "CHANGELOG.md" + - "crates/*/src/**" + workflow_dispatch: + +jobs: + dispatch: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Detect changed paths + id: changes + run: | + set -euo pipefail + base=$(git rev-parse HEAD~1 2>/dev/null || git rev-parse HEAD) + external=$(git diff --name-only "$base" HEAD -- 'docs' 'README.md' 'CHANGELOG.md' 'crates' | paste -sd, -) + { + echo "external=$external" + echo "has_external=$([ -n "$external" ] && echo true || echo false)" + } >> "$GITHUB_OUTPUT" + + - name: Dispatch to docs composer (makegov/docs) + if: steps.changes.outputs.has_external == 'true' + env: + GH_TOKEN: ${{ secrets.DOCS_DISPATCH_TOKEN }} + TARGET: ${{ vars.DOCS_TARGET_REPO || 'makegov/docs' }} + run: | + gh api "repos/$TARGET/dispatches" \ + -f event_type=external_updated \ + -f "client_payload[source_repo]=${{ github.repository }}" \ + -f "client_payload[source_ref]=${{ github.sha }}" \ + -f "client_payload[changed_paths]=${{ steps.changes.outputs.external }}" From 59713b0ef85818c4945f974e93afcce7ac6e30b6 Mon Sep 17 00:00:00 2001 From: "V. David Zvenyach" Date: Wed, 23 Sep 2026 10:02:27 -0500 Subject: [PATCH 2/2] ci(docs-dispatch): match the sibling SDKs' trigger paths and checkout version The docs composer consumes docs/, README.md and CHANGELOG.md, so a source-only change no longer pings it. Bumps actions/checkout to v6 to match tango-python. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/docs-dispatch.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/docs-dispatch.yml b/.github/workflows/docs-dispatch.yml index 202fe5f..5708e5c 100644 --- a/.github/workflows/docs-dispatch.yml +++ b/.github/workflows/docs-dispatch.yml @@ -1,9 +1,9 @@ name: Docs dispatch # Fires on push to main when content that affects the published docs site -# changes (docs/, README, CHANGELOG, or the public source of any workspace -# crate). Notifies makegov/docs via repository_dispatch so the docs site -# rebuilds without waiting for someone to push to the composer. +# changes (docs/, README, or CHANGELOG). Notifies makegov/docs via +# repository_dispatch so the docs site rebuilds without waiting for someone +# to push to the composer. # # tango-rust is a `coloc-source` repo: its docs/ folder is the authoritative # source for the Rust SDK pages on docs.makegov.com. @@ -22,7 +22,6 @@ on: - "docs/**" - "README.md" - "CHANGELOG.md" - - "crates/*/src/**" workflow_dispatch: jobs: @@ -31,7 +30,7 @@ jobs: permissions: contents: read steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 with: fetch-depth: 2 @@ -40,7 +39,7 @@ jobs: run: | set -euo pipefail base=$(git rev-parse HEAD~1 2>/dev/null || git rev-parse HEAD) - external=$(git diff --name-only "$base" HEAD -- 'docs' 'README.md' 'CHANGELOG.md' 'crates' | paste -sd, -) + external=$(git diff --name-only "$base" HEAD -- 'docs' 'README.md' 'CHANGELOG.md' | paste -sd, -) { echo "external=$external" echo "has_external=$([ -n "$external" ] && echo true || echo false)"