mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-09 08:11:19 +00:00
ci: preventing manual changes in erpnext/locale/*
This commit is contained in:
44
.github/workflows/prevent-locale-changes.yml
vendored
Normal file
44
.github/workflows/prevent-locale-changes.yml
vendored
Normal file
@@ -0,0 +1,44 @@
|
||||
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 })
|
||||
Reference in New Issue
Block a user