Skip to content

Commit b79bcc0

Browse files
authored
add github action to update doc (#37)
add a github action to automate a commit for updating docs if it's out of date. The action will run api extractor in local mode to build api report file, and the logLevel is updated to 'error' so api extractor will fail in local mode and action will exit with non-zero code also update build command to remove lib folder before running tsc and api extractor to ensure there's no old files in lib that may generate errors in local build. J=SLAP-1902 TEST=auto made a small change to a file's doc and push to pr. see that a commit is made from github action to update docs.
1 parent dbfba1b commit b79bcc0

File tree

6 files changed

+32
-45
lines changed

6 files changed

+32
-45
lines changed

.github/workflows/update_docs.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Check and Update Repo's documenation
2+
3+
on: pull_request
4+
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
node-version: [17.x]
12+
13+
steps:
14+
- uses: actions/checkout@v2
15+
- name: Use Node.js ${{ matrix.node-version }}
16+
uses: actions/setup-node@v2
17+
with:
18+
node-version: ${{ matrix.node-version }}
19+
- run: npm ci
20+
- run: npm run build
21+
- name: Update Documentation
22+
uses: EndBug/add-and-commit@v7
23+
with:
24+
message: "Automated update to repo's documentation from github action"
25+
add: '*.md'
26+
push: true
27+
default_author: github_actions

.github/workflows/validate_docs.yml

-21
This file was deleted.

api-extractor.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@
299299
*
300300
* DEFAULT VALUE: "warning"
301301
*/
302-
"logLevel": "warning"
302+
"logLevel": "error"
303303

304304
/**
305305
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
@@ -328,7 +328,7 @@
328328
*/
329329
"extractorMessageReporting": {
330330
"default": {
331-
"logLevel": "warning"
331+
"logLevel": "error"
332332
// "addToApiReportFile": false
333333
},
334334

@@ -352,7 +352,7 @@
352352
*/
353353
"tsdocMessageReporting": {
354354
"default": {
355-
"logLevel": "warning"
355+
"logLevel": "error"
356356
// "addToApiReportFile": false
357357
}
358358

package.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,10 @@
1010
"src"
1111
],
1212
"scripts": {
13-
"build": "tsc && npm run api-extractor && npm run generate-docs",
14-
"build-ci": "tsc && npm run api-extractor-ci && npm run generate-docs",
13+
"build": "rm -rf lib && tsc && npm run api-extractor && npm run generate-docs",
1514
"dev": "tsc --watch",
1615
"lint": "eslint .",
1716
"api-extractor": "api-extractor run --local --verbose",
18-
"api-extractor-ci": "api-extractor run --verbose",
1917
"generate-docs": "api-documenter markdown --input-folder temp --output-folder docs && rm -rf temp",
2018
"prepublishOnly": "npm run build",
2119
"test": "jest --passWithNoTests"

scripts/validate_docs.sh

-17
This file was deleted.

src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
export * from './components';
22
export * from './hooks';
33
export * from './models';
4-
export * from './sections';
4+
export * from './sections';

0 commit comments

Comments
 (0)