Skip to content

Commit 8035c9b

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

File tree

4 files changed

+55
-16
lines changed

4 files changed

+55
-16
lines changed

.circleci/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,17 +171,17 @@ workflows:
171171
- lint-test:
172172
requires:
173173
- install
174+
- build:
175+
requires:
176+
- install
174177
- dangerjs:
175178
pre-steps:
176179
- secrethub/env-export:
177180
secret-path: graviteeio/cicd/graviteebot/github_personal_access_token
178181
var-name: DANGER_GITHUB_API_TOKEN
179182
context: gravitee-qa
180183
requires:
181-
- install
182-
- build:
183-
requires:
184-
- install
184+
- build
185185
- prerelease:
186186
# Ignore this prerelease step on `master`
187187
filters:

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)