chore: prevent translation changes being merged without the correct configurations #10
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| on: | |
| pull_request: | |
| paths: | |
| - '**/assets/translations/**' | |
| env: | |
| NODE_VERSION: '20' | |
| name: Validate Configuration of Translation Files | |
| jobs: | |
| validate-translations: | |
| name: Validate Translations | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: Set up Node.js | |
| uses: actions/setup-node@v2 | |
| with: | |
| node-version: ${{ env.NODE_VERSION }} | |
| - name: Run Translation Validation Script | |
| run: | | |
| BASE_COMMIT=${{ github.event.pull_request.base.sha }} | |
| HEAD_COMMIT=${{ github.event.pull_request.head.sha }} | |
| changed_files=$(git diff --name-only $BASE_COMMIT $HEAD_COMMIT | grep 'assets/translations') | |
| if [ -n "$changed_files" ]; then | |
| for file in $changed_files; do | |
| folder_path=$(dirname "$file") | |
| echo "Changes detected in $folder_path" | |
| sh ./ci-scripts/validate-translations.sh "$folder_path" | |
| done | |
| else | |
| echo "No translation changes detected" | |
| exit 1 | |
| fi |