Skip to content

Commit 96f03b7

Browse files
committed
Align PR translation workflow with main base
1 parent 074e332 commit 96f03b7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/docs-pr.translate.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,19 @@ jobs:
123123
with:
124124
fetch-depth: 0
125125

126-
- name: Checkout PR revision
126+
- name: Populate PR content
127127
if: steps.collect.outputs.has_inputs == 'true'
128+
env:
129+
PR: ${{ steps.pr.outputs.pr_number }}
130+
INPUT_FILES: ${{ steps.collect.outputs.input_files }}
128131
run: |
129132
set -euo pipefail
130-
PR=${{ steps.pr.outputs.pr_number }}
131-
git fetch origin pull/${PR}/head
132-
git checkout -B translation-source-${PR} FETCH_HEAD
133+
git fetch --no-tags --depth=1 origin pull/${PR}/head:refs/remotes/origin/pr-${PR}
134+
for file in $INPUT_FILES; do
135+
clean_path=${file#./}
136+
mkdir -p "$(dirname "$clean_path")"
137+
git show origin/pr-${PR}:"$clean_path" > "$clean_path"
138+
done
133139
134140
- name: Snapshot existing translation branches
135141
if: steps.collect.outputs.has_inputs == 'true'

0 commit comments

Comments
 (0)