Skip to content

Commit fbbe10e

Browse files
committed
ci: add GitHub Actions workflow for documentation validation
1 parent a013e32 commit fbbe10e

1 file changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Documentation Validation
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- '**/*.md'
8+
- '**/*.markdown'
9+
- '**/*.asc'
10+
- '**/*.adoc'
11+
- '.github/workflows/docs-validation.yml'
12+
- '.docs-validator.toml'
13+
14+
pull_request:
15+
branches: [ main, master ]
16+
paths:
17+
- '**/*.md'
18+
- '**/*.markdown'
19+
- '**/*.asc'
20+
- '**/*.adoc'
21+
- '.github/workflows/docs-validation.yml'
22+
- '.docs-validator.toml'
23+
24+
workflow_dispatch:
25+
inputs:
26+
target_path:
27+
description: 'Path to scan'
28+
required: false
29+
default: '.'
30+
fail_on_error:
31+
description: 'Fail pipeline on errors'
32+
required: false
33+
type: boolean
34+
default: true
35+
36+
jobs:
37+
validate-docs:
38+
name: Validate Documentation Links
39+
runs-on: ubuntu-24.04
40+
41+
steps:
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@v5
47+
with:
48+
python-version: '3.13'
49+
50+
- name: Install docs-validator
51+
run: |
52+
python -m pip install --upgrade pip
53+
pip install git+https://github.com/Nokhrin/docs-validator.git
54+
55+
- name: Run documentation validation
56+
run: |
57+
FAIL_FLAG=""
58+
if [ "${{ github.event.inputs.fail_on_error }}" = "true" ] || [ -z "${{ github.event.inputs.fail_on_error }}" ]; then
59+
FAIL_FLAG="--fail-on-error"
60+
fi
61+
TARGET_PATH="${{ github.event.inputs.target_path || '.' }}"
62+
docs-validator scan "$TARGET_PATH" --validate $FAIL_FLAG --report markdown --output docs-validation-report.md
63+
64+
- name: Upload validation report
65+
if: always()
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: docs-validation-report
69+
path: docs-validation-report.md
70+
retention-days: 7

0 commit comments

Comments
 (0)