Skip to content

Commit e3b48c2

Browse files
committed
ci: TEMPORARY -- run the translate chain on this branch to validate the repair
Reverted before merge. The workflow only reacts to pushes on main, so the translate -> repair -> build chain cannot be exercised from a pull request at all. Adding this branch to the push trigger and to each step's guard runs it here instead; the push-back step targets github.ref, so the generated translation lands on this branch and main is untouched.
1 parent 6220122 commit e3b48c2

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

‎.github/workflows/main.yml‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
push:
1313
branches:
1414
- main
15+
# TEMPORARY (revert before merge): lets this branch exercise the
16+
# translate -> repair -> build chain, which only runs on push events.
17+
- ci/repair-machine-translated-link-targets
1518
workflow_dispatch:
1619

1720
jobs:
@@ -56,26 +59,26 @@ jobs:
5659
run: yarn --immutable
5760

5861
- name: generate id
59-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
62+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/repair-machine-translated-link-targets') # TEMPORARY: drop the second ref before merge
6063
run: ./add_id.sh docs/en/solutions && ./add_id.sh docs/en/articles
6164

6265
- name: translate
63-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
66+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/repair-machine-translated-link-targets') # TEMPORARY: drop the second ref before merge
6467
run: yarn translate -s en -t zh -g "*"
6568

6669
# Machine translation occasionally rewrites a link target -- it has emitted
6770
# the literal `URL` copied from its own prompt example -- which then fails
6871
# the build's dead-link check. Restore internal targets from English before
6972
# building, using the English document as the source of truth.
7073
- name: Repair machine-translated links
71-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
74+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/repair-machine-translated-link-targets') # TEMPORARY: drop the second ref before merge
7275
run: node scripts/check-translation-links.mjs --fix
7376

7477
- name: Build
7578
run: yarn build
7679

7780
- name: Commit
78-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
81+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/repair-machine-translated-link-targets') # TEMPORARY: drop the second ref before merge
7982
run: |
8083
git config user.name "github-actions[bot]"
8184
git config user.email "github-actions[bot]@users.noreply.github.com"
@@ -84,7 +87,7 @@ jobs:
8487
git commit -m "ci: update file from GitHub Action [skip ci]" || echo "Nothing to commit"
8588
8689
- name: Push changes
87-
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
90+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/repair-machine-translated-link-targets') # TEMPORARY: drop the second ref before merge
8891
uses: ad-m/github-push-action@master
8992
with:
9093
branch: ${{ github.ref }}
@@ -95,7 +98,7 @@ jobs:
9598
# model produced. Keep them for post-mortems. docs/en is included because
9699
# add_id.sh rewrites it earlier in the same run.
97100
- name: Upload generated docs on failure
98-
if: failure() && github.event_name == 'push' && github.ref == 'refs/heads/main'
101+
if: failure() && github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/ci/repair-machine-translated-link-targets') # TEMPORARY: drop the second ref before merge
99102
uses: actions/upload-artifact@v4
100103
with:
101104
name: generated-docs-${{ github.run_id }}

0 commit comments

Comments
 (0)