translation github action fix#172
Open
Jared-dz wants to merge 1 commit into
Open
Conversation
The old workflow triggered on push to main and tried to git push translations back to main, which has been rejected by branch protection since 2026-03-31 (GH013: "Changes must be made through a pull request"). Four PRs of doc edits merged with English-only changes as a result. Switch the trigger to pull_request (opened/synchronize/reopened) so the bot commits .es/.fr/.zh/etc. files onto the PR head branch before merge. - Diff base is now the PR base SHA instead of HEAD~1 - Loop guard switched to github.actor (head_commit.author is null on PR events) - Skip fork PRs (no secret access) - Concurrency group cancels in-progress runs on rapid pushes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git pushstep —mainis branch-protected (GH013: Changes must be made through a pull request), so the bot can't push translations directly. Four PRs of doc edits (Add OPS Management contributor documentation #164, subscribe branch #168, Update Edge Subscriber Connection.md #169, add api/ips to docs #170) merged without their translations.push: maintopull_request, so translations land inside the same PR as the English changes and never touch the protected branch.pull_requestevents (the oldhead_commit.authorcheck is null on PR events).What changed in
.github/workflows/translate.ymlpush: main→pull_request(opened, synchronize, reopened) ondocs/**.mdref: ${{ github.head_ref }}+fetch-depth: 0to access the PR base SHAHEAD~1→${{ github.event.pull_request.base.sha }}github.event.head_commit.author.name→github.actorgithub.event.pull_request.head.repo.full_name == github.repositoryto skip fork PRs (secrets aren't exposed there)concurrency: { group: translate-${{ github.head_ref }}, cancel-in-progress: true }HEAD:${{ github.head_ref }}instead ofmainscripts/translate.pyis unchanged — it's already env-driven.Test plan
The workflow's
paths:filter isdocs/**.md, so this PR won't trigger it. After merge, the first real test is the next PR that touches a doc file.docs/*.mdfilechore: auto-translate docscommit bygithub-actions[bot]lands on the PR branch with the.zh/.ja/.ko/.pt/.es/.fr/.itfilesgh run list --workflow=translate.ymlshould show only one run for the PR)Out of scope
architecture.md(stale translations) andcontribute-ops-management.md(no translations) will self-heal next time someone edits them.workflow_dispatchmanual trigger added — can be retrofitted later if catch-up becomes painful.pull_request_target(security risk for an internal docs repo).