Skip to content

Commit

Permalink
build: Run validate PO file wkflow only if PO files were changed
Browse files Browse the repository at this point in the history
  • Loading branch information
sarina committed Nov 7, 2023
1 parent 61bfeee commit 3fcf411
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion .github/workflows/validate-translation-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
name: Validate translation PO files

on:
pull_request:
- pull_request

jobs:
validate-po-files:
Expand All @@ -12,16 +12,28 @@ jobs:
contents: read
pull-requests: write
steps:
# Define .po filepaths, so we can skip this action unless a .po
# file has been modified in this diff
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
pofiles:
- '**.po'
# Clones the openedx-translations repo
- name: clone openedx/openedx-translations
if: steps.filter.outputs.pofiles == 'true'
uses: actions/checkout@v3

- name: Install gettext
if: steps.filter.outputs.pofiles == 'true'
run: |
sudo apt install -y gettext
- name: Validate translation files
id: validate_translation_files
if: steps.filter.outputs.pofiles == 'true'
run: |
has_validation_errors=0
python scripts/validate_translation_files.py 2>validation_errors.txt || has_validation_errors=1
Expand Down

0 comments on commit 3fcf411

Please sign in to comment.