Skip to content

feat: file reference linter #56

feat: file reference linter

feat: file reference linter #56

Workflow file for this run

name: Lint
on:
pull_request:
jobs:
file-ref-check:
name: file-ref-check
runs-on: ubuntu-latest
strategy:
matrix:
docs: [canary-checker, mission-control]
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
submodules: 'recursive'
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Install dependencies and build
run: |
cd ${{ matrix.docs }}
npm ci
npm run build
- name: Check for broken file references
run: |
cd ${{ matrix.docs }}/build
broken_files=$(grep -ril "file=../../../modules" *.html)
if [ -n "$broken_files" ]; then
echo "Error: Broken file references found in ${{ matrix.docs }}"
echo "Files with broken references:"
echo "$broken_files"
exit 1
else
echo "No broken file references found in ${{ matrix.docs }}"
fi
prettier:
name: prettier
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v4
with:
node-version: '20.11.1'
- name: Run format check
run: make fmt-check
continue-on-error: true
id: fmt-check
- name: Run formatter and show diff if check failed
if: steps.fmt-check.outcome == 'failure'
run: |
make fmt
git diff
- name: Exit with error if format check failed
if: steps.fmt-check.outcome == 'failure'
run: exit 1