diff --git a/.github/workflows/update-cli-docs.yml b/.github/workflows/update-cli-docs.yml index 84babfd552..b67a8278d6 100644 --- a/.github/workflows/update-cli-docs.yml +++ b/.github/workflows/update-cli-docs.yml @@ -77,6 +77,24 @@ jobs: go run ./cmd/gen-docs -input internal/temporalcli/commands.yaml -input cliext/option-sets.yaml -output dist/docs go run ./cmd/gen-docs -input ../cloud-cli/temporalcloudcli/commands.yml -output dist/docs -subdir cloud + - name: Copy generated command reference into the docs repo + working-directory: docs + run: | + set -ex + + # Regenerate the command reference pages. cp -R preserves the cloud/ + # subdirectory produced by -subdir. + rm -rf docs/cli/command-reference + mkdir -p docs/cli/command-reference + cp -R ../cli/dist/docs/* docs/cli/command-reference/ + + # gen-docs intentionally does not emit index.mdx landing pages: those + # are hand-maintained (custom ordering, embedded components such as + # ReleaseNoteHeader). Restore them after regeneration so they are not + # lost by the rm -rf above. + git checkout HEAD -- docs/cli/command-reference/index.mdx + git checkout HEAD -- docs/cli/command-reference/cloud/index.mdx + - name: Publish generated docs to documentation repo env: GH_TOKEN: ${{ github.token }} @@ -93,10 +111,7 @@ jobs: branch_name="update-cli-docs-$CLI_RELEASE_TAG" git checkout -b "$branch_name" - rm -rf docs/cli/command-reference - mkdir -p docs/cli/command-reference - cp -r ../cli/dist/docs/* docs/cli/command-reference/ - git add . + git add -A docs/cli/command-reference git commit -m "$COMMIT_MESSAGE" git push origin "$branch_name"