|
12 | 12 | push: |
13 | 13 | branches: |
14 | 14 | - 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 |
15 | 18 | workflow_dispatch: |
16 | 19 |
|
17 | 20 | jobs: |
@@ -56,26 +59,26 @@ jobs: |
56 | 59 | run: yarn --immutable |
57 | 60 |
|
58 | 61 | - 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 |
60 | 63 | run: ./add_id.sh docs/en/solutions && ./add_id.sh docs/en/articles |
61 | 64 |
|
62 | 65 | - 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 |
64 | 67 | run: yarn translate -s en -t zh -g "*" |
65 | 68 |
|
66 | 69 | # Machine translation occasionally rewrites a link target -- it has emitted |
67 | 70 | # the literal `URL` copied from its own prompt example -- which then fails |
68 | 71 | # the build's dead-link check. Restore internal targets from English before |
69 | 72 | # building, using the English document as the source of truth. |
70 | 73 | - 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 |
72 | 75 | run: node scripts/check-translation-links.mjs --fix |
73 | 76 |
|
74 | 77 | - name: Build |
75 | 78 | run: yarn build |
76 | 79 |
|
77 | 80 | - 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 |
79 | 82 | run: | |
80 | 83 | git config user.name "github-actions[bot]" |
81 | 84 | git config user.email "github-actions[bot]@users.noreply.github.com" |
|
84 | 87 | git commit -m "ci: update file from GitHub Action [skip ci]" || echo "Nothing to commit" |
85 | 88 | |
86 | 89 | - 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 |
88 | 91 | uses: ad-m/github-push-action@master |
89 | 92 | with: |
90 | 93 | branch: ${{ github.ref }} |
|
95 | 98 | # model produced. Keep them for post-mortems. docs/en is included because |
96 | 99 | # add_id.sh rewrites it earlier in the same run. |
97 | 100 | - 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 |
99 | 102 | uses: actions/upload-artifact@v4 |
100 | 103 | with: |
101 | 104 | name: generated-docs-${{ github.run_id }} |
|
0 commit comments