-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (110 loc) · 4 KB
/
Copy pathdocs-ci.yml
File metadata and controls
131 lines (110 loc) · 4 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: docs
on:
pull_request:
paths:
- '**.md'
- 'docs/**'
- 'llms.txt'
- 'upstream-versions.json'
- '.claude/**'
- 'commands/**'
- 'hooks/**'
- 'tests/**'
- '.github/workflows/**'
schedule:
# 15th of each month at 9am UTC (staggered from check-upstream on the 1st)
- cron: '0 9 15 * *'
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Lint Markdown
uses: DavidAnson/markdownlint-cli2-action@eb5ca3ab411449c66620fe7f1b3c9e10547144b0 # v18.0.0
with:
globs: '**/*.md'
- name: Spell check
uses: crate-ci/typos@631208b7aac2daa8b707f55e7331f9112b0e062d # v1.44.0
with:
config: _typos.toml
- name: Lint GitHub Actions workflows
uses: raven-actions/actionlint@205b530c5d9fa8f44ae9ed59f341a0db994aa6f8 # v2.1.2
links:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Check links
uses: lycheeverse/lychee-action@8646ba30535128ac92d33dfc9133794bfdd9b411 # v2.8.0
with:
args: >-
--exclude-private
--no-progress
--exclude "https://img.shields.io"
--exclude "https://shields.io"
--exclude "https://codex.openai.com"
--exclude "https://www.npmjs.com"
--exclude "https://github.com/littlebearapps/contextdocs/compare/"
--exclude "https://github.com/littlebearapps/contextdocs/releases/tag/"
docs/
README.md
CONTRIBUTING.md
CHANGELOG.md
AGENTS.md
llms.txt
fail: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
validate-plugin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Validate plugin.json
run: |
python3 -m json.tool .claude-plugin/plugin.json > /dev/null
for field in name version description; do
if ! python3 -c "import json; d=json.load(open('.claude-plugin/plugin.json')); assert '$field' in d, 'missing $field'"; then
echo "ERROR: plugin.json — missing '$field'"
exit 1
fi
done
echo "plugin.json valid"
- name: Validate evaluations.json
run: python3 -m json.tool tests/evaluations.json > /dev/null
- name: Validate upstream-versions.json
run: python3 -m json.tool upstream-versions.json > /dev/null
- name: Validate frontmatter (skills, commands)
run: python3 tests/validate-frontmatter.py
- name: Validate hook scripts
run: |
errors=0
for f in hooks/*.sh; do
if ! head -1 "$f" | grep -q "^#!/"; then
echo "ERROR: $f — missing shebang line"
errors=$((errors + 1))
fi
if ! bash -n "$f" 2>/dev/null; then
echo "ERROR: $f — bash syntax error"
errors=$((errors + 1))
fi
done
echo "Checked $(find hooks -name '*.sh' | wc -l) hook scripts"
[ "$errors" -eq 0 ] && echo "All hooks valid" || exit 1
- name: Run hook unit tests
run: bash tests/test-hooks.sh
- name: Check for banned phrases
run: bash tests/check-banned-phrases.sh README.md
consistency:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
- name: Validate llms.txt references and orphan detection
run: bash tests/validate-llms-txt.sh
- name: Validate AGENTS-first bridge model
run: bash tests/validate-bridge-model.sh
- name: Check token budgets
run: bash tests/check-token-budgets.sh
- name: Check version consistency
run: bash tests/check-version-consistency.sh