Skip to content

Commit

Permalink
ci: detect broken links using linkspector
Browse files Browse the repository at this point in the history
  • Loading branch information
Realiserad committed Jun 26, 2024
1 parent 75b7c8d commit 82646f8
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 1 deletion.
44 changes: 44 additions & 0 deletions .github/workflows/linkspector.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Linkspector
on:
pull_request:
jobs:
check-links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: reviewdog/action-setup@v1
with:
reviewdog_version: v0.17.4
- name: Create a configuration file
uses: 1arp/create-a-file-action@0.4.5
with:
file: .linkspector.yml
content: |
dirs: ['.']
useGitIgnore: true
modifiedFilesOnly: true
- name: Install Linkspector
run: |
npm install -g @umbrelladocs/linkspector@v0.3.10
- name: Scan PR for broken links
env:
GITHUB_TOKEN: '${{ github.token }}'
run: |
set +e
result=$(linkspector check -c .linkspector.yml -j)
status=$?
if echo "$result" | grep -q "Skipped link checking"; then
exit 0
fi
export REVIEWDOG_GITHUB_API_TOKEN="$GITHUB_TOKEN"
echo "$result" | reviewdog \
-f=rdjson \
-name="Linkspector" \
-reporter="github-pr-review" \
-filter-mode="added" \
-fail-on-error="false" \
-level="error" \
-tee
exit $status
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ server = http://localhost:11434/v1
model = llama3
```

If you use [OpenAI](https://platform.openai.com/login):
If you use [OpenAI](https://platform.openai.com):

```ini
[fish-ai]
Expand Down

0 comments on commit 82646f8

Please sign in to comment.