Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: detect broken links using linkspector #27

Merged
merged 1 commit into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading