mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 08:21:39 -06:00
8790208858
Use sparse target catalogs and validate Crowdin exports before proposing updates. Reject translation loss unless a maintainer acknowledges each key.
31 lines
1.0 KiB
YAML
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
|