-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (56 loc) · 2.21 KB
/
Copy pathcheck-index-sync.yml
File metadata and controls
66 lines (56 loc) · 2.21 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
name: Check Index is Synced
on:
pull_request:
paths:
- '**/metadata.yaml'
- 'README.md'
- 'docs/README-es.md'
branches:
- master
jobs:
check-sync:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout repository
uses: actions/checkout@v4
- name: 🐹 Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22'
cache: true
- name: 🔨 Build Go binaries
run: make build
- name: 💾 Save current READMEs
run: |
cp README.md README.md.backup
cp docs/README-es.md docs/README-es.md.backup
- name: 🔄 Regenerate index
run: bin/generate-index
- name: 🔍 Check if index is in sync
run: |
if ! diff -q README.md README.md.backup; then
echo "❌ README.md is out of sync with metadata!"
echo "Run 'make update-index' to sync the index."
echo ""
echo "## ⚠️ Index Out of Sync" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The talks index in README.md doesn't match the metadata files." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**To fix:** Run \`make update-index\` and commit the changes." >> $GITHUB_STEP_SUMMARY
exit 1
fi
if ! diff -q docs/README-es.md docs/README-es.md.backup; then
echo "❌ docs/README-es.md is out of sync with metadata!"
echo "Run 'make update-index' to sync the index."
echo ""
echo "## ⚠️ Index Out of Sync" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "The talks index in docs/README-es.md doesn't match the metadata files." >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "**To fix:** Run \`make update-index\` and commit the changes." >> $GITHUB_STEP_SUMMARY
exit 1
fi
echo "✅ Index is in sync with metadata!"
echo "## ✅ Index Synced" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "All talk indexes are properly synced with metadata files." >> $GITHUB_STEP_SUMMARY