Files
erpnext/.github/workflows/prevent-locale-changes.yml
2026-03-09 03:14:36 +05:30

44 lines
1.3 KiB
YAML

name: Prevent Locale Changes
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
check-locale:
permissions:
contents: read
runs-on: ubuntu-latest
if: github.actor != 'frappe-pr-bot'
# Exemption for the bot used for Crowdin Sync and POT File generation.
concurrency:
group: prevent-locale-changes-${{ github.event.pull_request.number }}
cancel-in-progress: true
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Detect locale changes
id: check
run: |
git fetch origin ${{ github.base_ref }}
if git diff --name-only origin/${{ github.base_ref }}...HEAD | grep -q '^erpnext/locale/'; then
echo "locale_changed=true" >> $GITHUB_OUTPUT
else
echo "locale_changed=false" >> $GITHUB_OUTPUT
fi
- name: Manage locale review
uses: actions/github-script@v7
with:
github-token: ${{ secrets.RELEASE_TOKEN }}
script: |
const localeChanged = "${{ steps.check.outputs.locale_changed }}" === "true"
const handler = require('./.github/helper/locale_review.js')
await handler({ github, context, localeChanged })