-
Notifications
You must be signed in to change notification settings - Fork 206
58 lines (49 loc) · 1.43 KB
/
overview-complete.yml
File metadata and controls
58 lines (49 loc) · 1.43 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
# Are all patterns shown somewhere in the main overview (README)?
name: Overview Complete
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
overviewComplete:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v47
- name: Filter markdown files only
run: |
md_files=`find ${{ steps.changed-files.outputs.all_changed_files }} -maxdepth 0 -name "*.md" | tr '\n' ' '`
echo "MARKDOWN_FILES=$md_files" >> $GITHUB_ENV
echo "$md_files"
- name: Check if all files exist in README
- run: |
README="README.md"
# Ensure README.md exists
if [[ ! -f "$README" ]]; then
echo "Error: $README not found!"
exit 1
fi
missing=0
for file in patterns/*/*.md; do
echo $file
if grep -qF "$file" "$README"; then
echo "✔ Found: $file"
else
echo "✘ Missing: $file"
missing=$((missing + 1))
fi
done
if [[ $missing -gt 0 ]]; then
echo "Some files are missing from $README."
exit 1
else
echo "All files are mentioned in $README."
exit 0
fi