name: LaTeX Lint on: push: branches: - main - dev paths: - 'latex/**/*.tex' - 'latex/main.tex' workflow_dispatch: jobs: lint: runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 - name: Install chktex run: | sudo apt-get update sudo apt-get install -y chktex - name: Run chktex inside latex/ working-directory: latex run: | TEX_FILES=$(find . -type f -name "*.tex") if [ -z "$TEX_FILES" ]; then echo "No .tex files found in latex/. Skipping lint." exit 0 fi echo "🔍 Linting .tex files with chktex..." FAIL=0 for f in $TEX_FILES; do echo "▶ Checking $f" # Run chktex and show output; capture error status if ! chktex "$f"; then echo "::warning file=$f::ChkTeX found issues in $f" FAIL=1 fi done if [ $FAIL -ne 0 ]; then echo "::error::❌ Lint errors or warnings were found in one or more .tex files above." exit 1 else echo "✅ All files passed chktex lint." fi