Skip to content

Commit 0f985d4

Browse files
authored
Merge branch 'main' into feat/ollama-output-format
2 parents 185f0c9 + 6811fb4 commit 0f985d4

File tree

3 files changed

+138
-86
lines changed

3 files changed

+138
-86
lines changed

.github/workflows/link-checker.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Check Markdown links
2+
3+
on:
4+
push:
5+
paths:
6+
- '**/*.md' # Only run when markdown files change
7+
pull_request:
8+
branches:
9+
- main
10+
schedule:
11+
- cron: '0 0 * * 0' # Run weekly on Sundays
12+
workflow_dispatch: # Allows manual triggering
13+
14+
jobs:
15+
linkChecker:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Link Checker
21+
uses: lycheeverse/[email protected]
22+
with:
23+
args: --verbose --no-progress --fail './**/*.md'
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
27+
- name: Create Issue If Failed
28+
if: failure()
29+
uses: actions/github-script@v6
30+
with:
31+
script: |
32+
const title = '🔗 Broken links found in documentation';
33+
const body = 'The link checker found broken links in the documentation. Please check the [workflow run](${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}/actions/runs/${process.env.GITHUB_RUN_ID}) for details.';
34+
35+
const existingIssues = await github.rest.issues.listForRepo({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
labels: 'documentation,broken-links',
39+
});
40+
41+
const issueExists = existingIssues.data.some(issue => issue.title === title);
42+
if (!issueExists) {
43+
await github.rest.issues.create({
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
title: title,
47+
body: body,
48+
labels: ['documentation', 'broken-links']
49+
});
50+
}

0 commit comments

Comments
 (0)