Skip to content

Commit 03cede8

Browse files
ci: preconfigure CI jobs (#3)
1 parent 852c219 commit 03cede8

File tree

6 files changed

+96
-33
lines changed

6 files changed

+96
-33
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false

.github/dependabot.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: /
5+
schedule:
6+
interval: weekly
7+
day: 'sunday'
8+
time: '02:00'
9+
timezone: Europe/Berlin
10+
groups:
11+
dependencies:
12+
dependency-type: production
13+
patterns:
14+
- '*'
15+
dev-dependencies:
16+
dependency-type: development
17+
patterns:
18+
- '*'
19+
- package-ecosystem: github-actions
20+
directory: /
21+
schedule:
22+
interval: weekly
23+
day: 'sunday'
24+
time: '04:00'
25+
timezone: Europe/Berlin
26+
groups:
27+
all:
28+
patterns:
29+
- '*'

.github/workflows/check-format.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/presubmit.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Check code before submitting
2+
3+
permissions: read-all
4+
5+
on:
6+
push:
7+
branches:
8+
- main
9+
pull_request:
10+
11+
jobs:
12+
check-format:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Check out repository
17+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
18+
with:
19+
fetch-depth: 2
20+
21+
- name: Set up Node.js
22+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
23+
with:
24+
cache: npm
25+
node-version-file: '.nvmrc'
26+
27+
- name: Install dependencies
28+
run: npm ci
29+
30+
- name: Run format check
31+
run: npm run check-format
32+
33+
check-docs:
34+
runs-on: ubuntu-latest
35+
36+
steps:
37+
- name: Check out repository
38+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
39+
with:
40+
fetch-depth: 2
41+
42+
- name: Set up Node.js
43+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
44+
with:
45+
cache: npm
46+
node-version-file: '.nvmrc'
47+
48+
- name: Install dependencies
49+
run: npm ci
50+
51+
- name: Generate documents
52+
run: npm run generate-docs
53+
54+
- name: Check if autogenerated docs differ
55+
run: |
56+
diff_file=$(mktemp doc_diff_XXXXXX)
57+
git diff --color > $diff_file
58+
if [[ -s $diff_file ]]; then
59+
echo "Please update the documentation by running 'npm run docs'. The following was the diff"
60+
cat $diff_file
61+
rm $diff_file
62+
exit 1
63+
fi
64+
rm $diff_file

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"build": "tsc && node --experimental-strip-types scripts/post-build.ts",
1212
"format": "eslint --cache --fix . ;prettier --write --cache .",
1313
"check-format": "eslint --cache .; prettier --check --cache .;",
14-
"generate-docs": "node --experimental-strip-types scripts/generate-docs.ts",
14+
"generate-docs": "npm run build && node --experimental-strip-types scripts/generate-docs.ts",
1515
"start": "npm run build && node build/src/index.js",
1616
"start-debug": "DEBUG=mcp:* DEBUG_COLORS=false npm run build && node build/src/index.js",
1717
"test": "npm run build && npx puppeteer browsers install chrome@latest && PUPPETEER_CHROME_VERSION=latest node --test-force-exit --test 'build/tests/**/*.test.js'",

scripts/generate-docs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function updateReadmeWithConfigOptions(help: string): void {
119119
const before = readmeContent.substring(0, beginIndex + beginMarker.length);
120120
const after = readmeContent.substring(endIndex);
121121

122-
const updatedContent = before + '\n\n```sh\n' + help + '```\n' + after;
122+
const updatedContent = before + '\n\n```sh\n' + help + '```\n\n' + after;
123123

124124
fs.writeFileSync(README_PATH, updatedContent);
125125
console.log('Updated README.md with config options');

0 commit comments

Comments
 (0)