Fix: Run PO to JSON validation on PRs and bulletproof git diffs#6116
Fix: Run PO to JSON validation on PRs and bulletproof git diffs#6116varruunnn wants to merge 1 commit intosugarlabs:masterfrom
Conversation
|
✅ All Jest tests passed! This PR is ready to merge. |
i feel this works fine if possible ( you just need to edit the template)) and save it ci workflow runs |
Screen.Recording.2026-03-06.072037.mp4it works fine |
|
@Ashutoshx7 this pr solves different issue this is actually a kind of bug only but if you want me to add this under performance or feature tag i'll add it let me know |
if possible can u make the pr description a bit more clear |
|
@Ashutoshx7 is it fine now? |

The Bug (Why we need this PR)

Right now, the translation check only runs after a Pull Request is merged.
If a contributor changes a .po file but forgets to convert it to a .json file, their PR will still get a green checkmark ✅. But as soon as a maintainer clicks "Merge", the check runs on the master branch, fails, and breaks the repository for everyone.
Refer Image from Issue #6115
CLOSES #6115

The Fix
This PR forces the translation check to run before the PR is merged.
To make that work without crashing the bot, I made three small changes to the script:
Added
pull_requestto the triggers: Now, if someone forgets to convert their translation files, the bot will block their PR with a red ❌ so maintainers don't accidentally merge broken files.Fixed the file checker: The old script only knew how to check files for push events. I added an if/else statement so the script knows how to find changed files during a Pull Request.
Prevented random crashes: Sometimes GitHub Actions forgets to download the master branch before checking the files. I added one line (git fetch) to force it to download the branch so the script doesn't crash with a fatal: bad object error.