Skip to content

Commit b022253

Browse files
committed
fix gha error logic
1 parent d10e2b1 commit b022253

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.github/workflows/build-ota-updates.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,9 @@ jobs:
4444
else
4545
echo "::notice title=No updates::No translations were updated."
4646
fi
47+
- name: Check for PO compilation errors
48+
run: |
49+
if [ -f ota-had-errors ]; then
50+
echo "::warning::Some strings were removed from OTA translations due to errors."
51+
exit 1
52+
fi

scripts/build-ota-translations.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trap finish EXIT
1313
recode-sr-latin <locales/sr.po >locales/sr@latin.po
1414

1515
# check PO files for errors and fix the ones that won't compile:
16-
uv run scripts/check-translations.py --github --remove-errors
16+
uv run scripts/check-translations.py --github --remove-errors || touch ota-had-errors
1717
# double-check that fixes were correct:
1818
for po in locales/*.po ; do
1919
msgfmt -c -o /dev/null $po

scripts/check-translations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def main():
9393

9494
po_files = glob.glob('locales/*.po')
9595
status = check_translations(po_files, args.github, args.remove_errors)
96-
if not status and not args.remove_errors:
96+
if not status:
9797
sys.exit(1)
9898

9999

0 commit comments

Comments
 (0)