Files
bookorbit/.github/workflows/crowdin-branch-cleanup.yml
T
neon 8790208858 fix(client): prevent Crowdin translation loss
Use sparse target catalogs and validate Crowdin exports before proposing updates. Reject translation loss unless a maintainer acknowledges each key.
2026-08-05 23:02:58 +00:00

31 lines
1.0 KiB
YAML

name: Crowdin Branch Cleanup
on:
pull_request:
types: [closed]
permissions:
contents: write
jobs:
delete-service-branch:
# The controlled export workflow reuses this branch for its translation PR.
# Removing it after close guarantees that the next export starts from current main.
if: github.event.pull_request.head.ref == 'l10n_main' && github.event.pull_request.head.repo.full_name == github.repository
name: Delete l10n_main
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Delete the Crowdin service branch
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
BRANCH: l10n_main
run: |
if gh api "repos/$REPO/git/refs/heads/$BRANCH" >/dev/null 2>&1; then
gh api -X DELETE "repos/$REPO/git/refs/heads/$BRANCH"
echo "Deleted $BRANCH; the translation workflow will recreate it from main when needed."
else
echo "$BRANCH is already absent; nothing to delete."
fi