Skip to content

Commit

Permalink
ci: check untracked files after build
Browse files Browse the repository at this point in the history
  • Loading branch information
gcusnieux committed Nov 10, 2021
1 parent 2b08878 commit 72df0ca
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions dangerfile.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
import { danger, markdown } from 'danger';
import { danger, markdown, fail } from 'danger';
import simpleGit, {SimpleGit} from 'simple-git';
const git: SimpleGit = simpleGit();

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

if (modifiedDefinitionJson.edited) {
markdown(`
Hey dear reviewer, I'm the Gravitee.io bot :robot:
Hey dude, I'm the Gravitee.io bot :robot:
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!
Also, after merging this PR, you should update the \`definition.json\` of [APIM Rest API](https://github.com/gravitee-io/gravitee-management-rest-api).
`);
}

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

}
});

0 comments on commit 72df0ca

Please sign in to comment.