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 9001a5a commit 46f013b
Show file tree
Hide file tree
Showing 3 changed files with 47 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 LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Tom Dörr, Bastian Fredriksson and GitHub Contributors
Copyright (c) 2024 Tom Dörr, Bastian Fredriksson and GitHub contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ self-hosted LLM behind any OpenAI-compatible API.

If you like it, please add a ⭐. If you don't like it, create a PR. 😆

Here is a broken link: <https://broken.stormhub.org>

## 🎥 Demo

![demo](https://github.com/Realiserad/fish-ai/assets/6617918/49d8a959-8f6c-48d8-b788-93c560617c28)
Expand Down

0 comments on commit 46f013b

Please sign in to comment.