Repository navigation
64 lines (49 loc) · 1.34 KB
/
Copy pathci.yml
File metadata and controls
64 lines (49 loc) · 1.34 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
name: CI
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
jobs:
repository-hygiene:
name: Repository hygiene
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v6
- name: Set up Node.js
uses: actions/setup-node@v6
with:
node-version: 20
- name: Validate required project files
run: |
set -euo pipefail
required_files=(
README.md
LICENSE
)
for file in "${required_files[@]}"; do
test -s "$file"
done
- name: Validate markdown files are not empty
run: |
set -euo pipefail
markdown_count=0
while IFS= read -r -d '' file; do
markdown_count=$((markdown_count + 1))
test -s "$file"
done < <(find . -type f -name '*.md' -not -path './.git/*' -print0)
if [ "$markdown_count" -eq 0 ]; then
echo "No markdown files found."
exit 1
fi
- name: Install dependencies
if: hashFiles('package-lock.json') != ''
run: npm ci
- name: Run repository validation
run: bash scripts/validate.sh
- name: Verify published package contents
run: npm run package:smoke