-
-
Notifications
You must be signed in to change notification settings - Fork 1
65 lines (55 loc) · 1.96 KB
/
Copy pathgenerate-readme.yml
File metadata and controls
65 lines (55 loc) · 1.96 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
name: Check README Sync
on:
pull_request:
paths:
- 'extensions/git-id-switcher/docs/i18n/en/README.md'
- 'extensions/git-id-switcher/README.md'
workflow_dispatch: # Manual trigger for verification
permissions: {}
# README auto-generation is handled by local pre-commit hook (husky)
# This workflow only verifies sync as a safety net
jobs:
check-sync:
name: Verify README is in sync
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Harden Runner
uses: step-security/harden-runner@9af89fc71515a100421586dfdb3dc9c984fbf411 # v2.19.4
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
- name: Setup Node.js
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
with:
node-version: '24'
cache: 'npm'
cache-dependency-path: package-lock.json
# Install at root level for npm workspaces
- name: Install dependencies
run: npm ci
- name: Generate README (dry-run)
working-directory: extensions/git-id-switcher
run: npm run generate:readme
- name: Verify sync
working-directory: extensions/git-id-switcher
run: |
if git diff --quiet README.md; then
echo "✅ README.md is in sync with docs/i18n/en/README.md"
else
echo "::error::README.md is out of sync with docs/i18n/en/README.md"
echo ""
echo "The pre-commit hook should have handled this automatically."
echo "If you bypassed the hook, please run:"
echo ""
echo " cd extensions/git-id-switcher"
echo " npm run generate:readme"
echo " git add README.md"
echo " git commit --amend --no-edit"
echo ""
echo "Diff:"
git diff README.md
exit 1
fi