File tree Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Expand file tree Collapse file tree 3 files changed +41
-2
lines changed Original file line number Diff line number Diff line change 2020 run : node . run posttest
2121 env :
2222 DEPLOY_VERSION : testing
23-
23+
24+ check_docs :
25+ runs-on : ubuntu-latest
26+ steps :
27+ - uses : actions/checkout@v2
28+ - name : Use Node.js 14.x
29+ uses : actions/setup-node@v1
30+ with :
31+ node-version : 14.x
32+ - name : Install dependencies
33+ run : |
34+ node . install --ignore-scripts --no-audit
35+ - name : Rebuild the docs
36+ run : make freshdocs
37+ - name : Git should not be dirty
38+ run : node scripts/git-dirty.js
39+
40+
2441 licenses :
2542 runs-on : ubuntu-latest
2643 steps :
Original file line number Diff line number Diff line change @@ -76,6 +76,12 @@ docs/content/using-npm/config.md: scripts/config-doc.js lib/utils/config/*.js
7676docs/content/commands/npm-% .md : lib/% .js scripts/config-doc-command.js lib/utils/config/* .js
7777 node scripts/config-doc-command.js $@ $<
7878
79+ freshdocs :
80+ touch lib/utils/config/definitions.js
81+ touch scripts/config-doc-command.js
82+ touch scripts/config-doc.js
83+ make docs
84+
7985test : dev-deps
8086 node bin/npm-cli.js test
8187
@@ -109,4 +115,4 @@ publish: gitclean ls-ok link test smoke-tests docs prune
109115release : gitclean ls-ok docs prune
110116 @bash scripts/release.sh
111117
112- .PHONY : all latest install dev link docs clean uninstall test man docs-clean docsclean release ls-ok dev-deps prune
118+ .PHONY : all latest install dev link docs clean uninstall test man docs-clean docsclean release ls-ok dev-deps prune freshdocs
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env node
2+ const { spawnSync } = require ( 'child_process' )
3+ const changes = spawnSync ( 'git' , [ 'status' , '--porcelain' , '-uno' ] )
4+ const stdout = changes . stdout . toString ( 'utf8' )
5+ const stderr = changes . stderr . toString ( 'utf8' )
6+ const { status, signal } = changes
7+ console . log ( stdout )
8+ console . error ( stderr )
9+ if ( status || signal ) {
10+ console . error ( { status, signal } )
11+ process . exitCode = status || 1
12+ }
13+ if ( stdout . trim ( ) !== '' )
14+ throw new Error ( 'git dirty' )
15+ else
16+ console . log ( 'git clean' )
You can’t perform that action at this time.
0 commit comments