docs: rejected proposal the fuzzy strings #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run pull request tests and validation for openedx-translations | |
name: CI | |
on: | |
- pull_request | |
jobs: | |
# Run unit and integration tests for Python | |
tests: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
pull-requests: write | |
statuses: write | |
steps: | |
- name: clone openedx/openedx-translations | |
uses: actions/checkout@v3 | |
- name: Allow editing translation files for bot pull requests | |
env: | |
# secrets can't be used in job conditionals, so we set them to env here | |
TRANSIFEX_APP_ACTOR_NAME: "${{ secrets.TRANSIFEX_APP_ACTOR_NAME }}" | |
TRANSIFEX_APP_ACTOR_ID: "${{ secrets.TRANSIFEX_APP_ACTOR_ID }}" | |
if: "${{ github.actor == env.TRANSIFEX_APP_ACTOR_NAME && github.actor_id == env.TRANSIFEX_APP_ACTOR_ID }}" | |
run: | | |
echo "VALIDATION_OPTIONS=--mark-fuzzy" >> "$GITHUB_ENV" | |
- name: Validate translation files | |
id: validate_translation_files | |
run: | | |
has_errors=0 | |
python scripts/validate_translation_files.py $VALIDATION_OPTIONS 2>error_log.txt || has_errors=1 | |
cat error_log.txt # Print the errors to the console for debugging | |
# Save the validation errors to an output variable | |
{ | |
echo 'ERROR_LOG<<EOF' | |
fold -w 100 -s error_log.txt | |
echo EOF | |
} >> "$GITHUB_OUTPUT" | |
exit $has_errors | |
- name: Post translation validation results as a pull request comment | |
# Due to GitHub Actions security reasons posting a comment isn't possible on fork pull requests. | |
# This shouldn't be an issue, because bots writes directly to this repository. | |
if: ${{ always() && github.event.repository.full_name == github.event.pull_request.head.repo.full_name }} | |
uses: mshick/add-pr-comment@7c0890544fb33b0bdd2e59467fbacb62e028a096 | |
with: | |
message: | | |
:white_check_mark: All translation files are valid. | |
``` | |
${{ steps.validate_translation_files.outputs.ERROR_LOG || 'No errors were reported.' }} | |
``` | |
This comment has been posted by the `validate-translation-files.yml` GitHub Actions workflow. | |
message-failure: | | |
:warning: There are errors in the translation files: | |
``` | |
${{ steps.validate_translation_files.outputs.ERROR_LOG || 'No errors were reported.' }} | |
``` | |
This comment has been posted by the `validate-translation-files.yml` GitHub Actions workflow. |