workflow: sync multi-language docs from changed source docs on main#3626
workflow: sync multi-language docs from changed source docs on main#3626Copilot wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54d2ef4c28
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| MODEL_ENDPOINT: https://models.inference.ai.azure.com/chat/completions | ||
| MODEL_NAME: gpt-4.1-mini |
There was a problem hiding this comment.
Switch to the supported GitHub Models API configuration
Every docs push reaches an endpoint that no longer serves GitHub Models requests. GitHub's deprecation notice states that support for https://models.inference.ai.azure.com was removed on October 17, 2025, and the current REST API documentation uses https://models.github.ai/inference/chat/completions with publisher-qualified model IDs such as openai/gpt-4.1. Update both values here, including changing the model to its catalog ID such as openai/gpt-4.1-mini; otherwise the newly added workflow fails before it can synchronize any translation.
Useful? React with 👍 / 👎.
| target_path = render_path(target_locale, relative_path) | ||
| if not target_path.exists(): | ||
| continue | ||
| updates[target_path] = (source_locale, target_locale, source_content, relative_path) |
There was a problem hiding this comment.
Preserve locale files that were edited in the triggering push
When one push intentionally updates the same document in multiple locales, each source schedules translations for every other locale and this assignment silently replaces any earlier scheduled value for the same target. This is a real repository workflow: for example, commit 1756c6e edits advanced/contribution.md in the root and every locale directory together. With that kind of push, the loop eventually overwrites the manually maintained documents with model output derived from whichever locale happens to appear last in git diff --name-only, and even the last source locale is overwritten by the preceding source. Exclude targets present in changed_files and define an authoritative source before populating updates.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
Adds an automated GitHub Actions workflow to synchronize changed Markdown documentation across existing locale folders using GitHub Models translation.
Changes:
- Adds a
pushworkflow formaindoc Markdown changes. - Detects changed docs, maps source/target locales, and translates existing counterpart files.
- Commits updated translations back to the repository when content changes.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| git commit -m "docs: sync docs translations [skip ci]" | ||
| git push |
There was a problem hiding this comment.
Fixed in the latest commit by adding a workflow_run trigger to docs-deploy.yml. The deploy workflow now also fires when the "Sync translated docs" workflow completes on main, so translated docs are deployed even though the translation commit is pushed via GITHUB_TOKEN (which doesn't trigger other workflows) and carries [skip ci].
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Docs are maintained in multiple language folders, but updates in one language were not propagated to others. This PR adds an automated sync workflow that detects changed docs on
mainand updates corresponding files in other locales via model-based translation.Workflow trigger and guardrails
.github/workflows/docs-translation-sync.yml.pushtomainfordocs/src/**/*.md.github-actions[bot]to prevent translation-commit loops.Change detection and locale mapping
${{ github.event.before }}..${{ github.sha }}to find modified markdown files.de,en,es,fr,id,it,jp,ko-KR,pt-BR,ru,vi-VN,zh-TW, and root aszh-CN).Translation execution
https://models.inference.ai.azure.com/chat/completions) withgpt-4.1-mini.Write-back behavior