Files
thesis/.github/workflows/latex-lint.yml
2025-06-03 15:16:16 +07:00

45 lines
944 B
YAML

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
chktex -q -n1 "$f" || FAIL=1
done
if [ $FAIL -ne 0 ]; then
echo "::error::Lint errors detected."
exit 1
fi