Skip to content

chore: prevent translation changes being merged without the correct configurations #3

chore: prevent translation changes being merged without the correct configurations

chore: prevent translation changes being merged without the correct configurations #3

name: Check Translation Changes
on:
pull_request:
paths:
- '**/assets/translations/**'
jobs:
check-translations:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0 # Fetch all history for all branches and tags
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '14'
- name: Debugging information
run: |
echo "BASE_COMMIT: ${{ github.event.pull_request.base.sha }}"
echo "HEAD_COMMIT: ${{ github.event.pull_request.head.sha }}"
git log --oneline -5
- name: Run translation change 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 ./scripts/handle-translation-changes.sh "$folder_path"
done
else
echo "No translation changes detected"
fi