Skip to content

Commit f38d0a3

Browse files
authored
Add pipeline check that ensures docs and commands synchronisation (#117)
1 parent 2d44731 commit f38d0a3

3 files changed

Lines changed: 18 additions & 1 deletion

File tree

.github/workflows/ci.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,18 @@ jobs:
4242
name: build
4343
path: dist
4444

45+
- name: Run docs-generator
46+
run: npm run docs-generator
47+
48+
- name: Check for documentation changes
49+
run: |
50+
if [[ -n $(git status --porcelain docs/) ]]; then
51+
echo "The following files in the docs directory and/or the commands related to them have been modified:"
52+
git status --porcelain docs/
53+
echo "Please run 'npm run docs-generator' locally and commit the changes."
54+
exit 1
55+
fi
56+
4557
- name: Audit
4658
run: npm audit
4759

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ git checkout -b johndoe/add-auth-command
6363
### **3. Make Your Changes**
6464
- Follow existing code patterns and structure.
6565
- Write clear commit messages.
66+
- **If you add a new command or modify documentation**, run the following command to ensure commands and documentation are synchronized:
67+
```bash
68+
npm run docs-generator
69+
```
6670

6771
### **4. Commit Your Changes**
6872
```bash

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@
165165
"test:formatting": "mocha --forbid-only \"integration-tests/main-cases/formatting.test.ts\"",
166166
"test:service": "mocha --forbid-only \"integration-tests/main-cases/service-client.test.ts\"",
167167
"test:native": "mocha --forbid-only \"integration-tests/main-cases/native-client.test.ts\"",
168-
"version": "oclif readme && git add README.md"
168+
"version": "oclif readme && git add README.md",
169+
"docs-generator": "node ./bin/run.js docs-generator"
169170
},
170171
"types": "dist/index.d.ts"
171172
}

0 commit comments

Comments
 (0)