Skip to content

Commit 2ae7264

Browse files
committed
ci: check untracked files after build
1 parent 2b08878 commit 2ae7264

File tree

3 files changed

+51
-12
lines changed

3 files changed

+51
-12
lines changed

dangerfile.ts

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
1-
import { danger, markdown } from 'danger';
1+
import { danger, markdown, fail } from 'danger';
2+
import simpleGit, {SimpleGit} from 'simple-git';
3+
const git: SimpleGit = simpleGit();
24

35
const modifiedDefinitionJson = danger.git.fileMatch('src/theme/definition.json');
46

57
if (modifiedDefinitionJson.edited) {
68
markdown(`
7-
Hey dear reviewer, I'm the Gravitee.io bot :robot:
9+
Hey dude, I'm the Gravitee.io bot :robot:
810
911
I just want to tell you that \`definition.json\` has been updated in this PR. As this file is used to theme clients' portals you should carefully review it to avoid any regression!
1012
1113
Also, after merging this PR, you should update the \`definition.json\` of [APIM Rest API](https://github.com/gravitee-io/gravitee-management-rest-api).
1214
`);
1315
}
1416

15-
const packageJson = danger.git.fileMatch('package.json');
17+
git.status().then(result => {
18+
if(result.modified.length > 0) {
19+
fail(`
20+
Hey dude, I'm the Gravitee.io bot :robot:
1621
17-
if (packageJson.edited) {
18-
markdown(`
19-
Hey dear reviewer, I'm the Gravitee.io bot :robot:
20-
21-
I just want to tell you that \`package.json\` has been updated in this PR.
22-
23-
Some components are based on third party libraries, for integration into a web component, we extract the css from its libraries as assets.
22+
There is some untracked files after \`npm run build\` command.
2423
25-
WARNING: When \`codemirror\`, \`highlight.js\` or \`github-markdown-css\` are updated, we must run \`npm run build\` task to update the css.
24+
Could you run build command locally and fix-it ?
2625
`);
27-
}
26+
27+
}
28+
});

package-lock.json

Lines changed: 37 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
"pascal-case": "3.1.2",
117117
"prettier": "2.4.1",
118118
"semantic-release": "18.0.0",
119+
"simple-git": "^2.47.0",
119120
"sort-package-json": "1.52.0",
120121
"svgo": "2.8.0",
121122
"svgstore": "3.0.1",

0 commit comments

Comments
 (0)