Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/docs-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ jobs:
- name: Checkout example repo
uses: actions/checkout@v4

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '20'
Comment on lines +39 to +42

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Changelog Entry Missing

This workflow change does not update CHANGELOG.md. The repository requires every change to add an entry under ## [Unreleased] describing what changed and why. This requirement must be satisfied before merging.

Context Used: CLAUDE.md (source)

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!


- name: Set up Python
uses: actions/setup-python@v5
with:
Expand Down Expand Up @@ -92,6 +97,25 @@ jobs:
--input docs/ \
--output-dir cosmos-docs/sdk/next/tutorials/example/

# The example tutorials are the one exception to cosmos/docs' version
# freeze. They tell the reader to `git clone` this repo and
# `git checkout main`, so they document whatever main is now rather than a
# released version, and a frozen latest/ copy just describes code the
# reader is not running. Before this step existed, latest/ sat two syncs
# behind for months.
#
# The script and the reasoning live in cosmos/docs, so only the call is
# here. Skipped if it is absent, which keeps this workflow working whether
# it merges before or after the cosmos/docs side.
- name: Forward-port the tutorials into latest/
run: |
cd cosmos-docs
if [ ! -f scripts/sync-next-to-latest.js ]; then
echo "::warning::scripts/sync-next-to-latest.js is not on cosmos/docs main yet, skipping the forward-port. latest/ will lag until it lands."
exit 0
fi
node scripts/sync-next-to-latest.js sdk/next/tutorials/example/

- name: Commit, then open or update the PR on cosmos/docs
env:
GH_TOKEN: ${{ secrets.DOCS_REPO_TOKEN }}
Expand All @@ -105,6 +129,7 @@ jobs:
git remote set-url origin "https://x-access-token:${{ secrets.DOCS_REPO_TOKEN }}@github.com/cosmos/docs.git"

git add sdk/next/tutorials/example/
git add sdk/latest/tutorials/example/

if git diff --cached --quiet; then
echo "No doc changes to sync, nothing to commit."
Expand Down