Skip to content

Commit

Permalink
feat: file reference linter
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Sep 16, 2024
1 parent bb666be commit 61e4060
Showing 1 changed file with 38 additions and 2 deletions.
40 changes: 38 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,44 @@
name: Format
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=$(find . -type f -name "*.html" -exec grep -il "file=../../../modules" {} +)
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 }}"
exit 0
fi
prettier:
name: prettier
runs-on: ubuntu-latest
Expand All @@ -26,4 +62,4 @@ jobs:
- name: Exit with error if format check failed
if: steps.fmt-check.outcome == 'failure'
run: exit 1
run: exit 1

0 comments on commit 61e4060

Please sign in to comment.