Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion .github/workflows/site-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ jobs:
echo "merge_sha=$merge_sha" >> "$GITHUB_OUTPUT"
echo "trust=$trust" >> "$GITHUB_OUTPUT"

- name: Select translated collections from pull request labels
- name: Select translated collections for preview
id: translations
env:
GH_TOKEN: ${{ github.token }}
Expand All @@ -123,9 +123,24 @@ jobs:
mapfile -t labels < <(
gh api --paginate "repos/$GITHUB_REPOSITORY/issues/$PULL_REQUEST_NUMBER/labels" --jq '.[].name'
)
mapfile -t changed_files < <(
gh api --paginate "repos/$GITHUB_REPOSITORY/pulls/$PULL_REQUEST_NUMBER/files" --jq '.[].filename'
)
known_locales=(ar es fr ja ko pt-BR ru zh)
include_translations=false

# These files configure both Vercel applications. Always exercise
# the translations project when they change, even when the author
# did not request a translated-content preview explicitly.
for file in "${changed_files[@]}"; do
case "$file" in
vercel.json|microfrontends.json)
include_translations=true
echo "Including translations because shared deployment configuration changed: $file"
;;
esac
done

for label in "${labels[@]}"; do
normalized="${label,,}"
if [[ "$normalized" == "docs-translations-all" ]]; then
Expand Down
Loading