Skip to content

Commit 72df0ca

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

1 file changed

Lines changed: 13 additions & 12 deletions

File tree

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+
});

0 commit comments

Comments
 (0)