name: Validate Language Files

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  run:
    name: Validate Language Files
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the branch
        uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
      - name: Run validate command
        run: python manage.py validatelangfiles | tee validate_output.txt
      - name: Read output file
        id: validate_output
        uses: juliangruber/read-file-action@v1
        with:
          path: ./validate_output.txt
      - name: Comment on pull request
        uses: thollander/actions-comment-pull-request@main
        if: "${{ contains(steps.validate_output.outputs.content, 'errors found') }}"
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          message: '**Validate Language Files**

Output:

${{ steps.validate_output.outputs.content }}


If the output is blank, all checks passed.

If there are errors, you should fix those before the PR will pass.

If there are warnings, those are optional and you should consider whether to change them or not.
'

      - name: Check for command failures
        if: "${{ contains(steps.validate_output.outputs.content, 'errors found') }}"
        with:
          fail_ci_if_error: true
        run: |
          exit 1
name: Validate Language Files

on:
  push:
    branches:
      - main
  pull_request:
    branches:
      - main

jobs:
  run:
    name: Validate Language Files
    runs-on: ubuntu-latest
    steps:
      - name: Checkout the branch
        uses: actions/checkout@v2
      - name: Set up Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.9
      - name: Install dependencies
        run: |
          python -m pip install --upgrade pip
          pip install -r requirements.txt
      - name: Run validate command
        run: python manage.py validatelangfiles | tee validate_output.txt
      - name: Read output file
        id: validate_output
        uses: juliangruber/read-file-action@v1
        with:
          path: ./validate_output.txt
      - name: Comment on pull request
        uses: thollander/actions-comment-pull-request@main
        if: "${{ contains(steps.validate_output.outputs.content, 'errors found') }}"
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          message: '**Validate Language Files**

Output:

${{ steps.validate_output.outputs.content }}


If the output is blank, all checks passed.

If there are errors, you should fix those before the PR will pass.

If there are warnings, those are optional and you should consider whether to change them or not.
'

      - name: Check for command failures
        if: "${{ contains(steps.validate_output.outputs.content, 'errors found') }}"
        run: |
          exit 1
Revise how command errors (try 3)
Revise how command errors (try 3)
