-
Notifications
You must be signed in to change notification settings - Fork 10
63 lines (57 loc) · 1.6 KB
/
markdown-docs.yml
File metadata and controls
63 lines (57 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Pointer Docs
on:
push:
branches:
- main
paths:
- '**/*.md'
- '.github/workflows/markdown-docs.yml'
pull_request:
branches:
- main
paths:
- '**/*.md'
- '.github/workflows/markdown-docs.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
docs:
name: Documentation links
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Validate README image references
run: |
node <<'NODE'
const fs = require('fs');
const path = require('path');
const readme = fs.readFileSync('README.md', 'utf8');
const imageRefs = [...readme.matchAll(/<img[^>]+src="([^"]+)"/g)].map(match => match[1]);
for (const ref of imageRefs) {
if (/^https?:\/\//.test(ref)) {
continue;
}
const decoded = decodeURIComponent(ref);
if (!fs.existsSync(decoded)) {
throw new Error(`README image reference is missing: ${ref}`);
}
}
console.log(`Validated ${imageRefs.length} README image references.`);
NODE
- name: Validate documentation map
run: |
for file in \
README.md \
CONTRIBUTING.md \
AGENTS.md \
docs/PROJECT_GUIDE.md \
docs/TECH_STACK.md \
docs/RELEASE.md \
.github/copilot-instructions.md \
.github/instructions/pointer-project.instructions.md
do
test -f "$file"
done