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 9b9613d
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 16 deletions.
11 changes: 7 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -171,17 +171,17 @@ workflows:
- lint-test:
requires:
- install
- build:
requires:
- install
- dangerjs:
pre-steps:
- secrethub/env-export:
secret-path: graviteeio/cicd/graviteebot/github_personal_access_token
var-name: DANGER_GITHUB_API_TOKEN
context: gravitee-qa
requires:
- install
- build:
requires:
- install
- build
- prerelease:
# Ignore this prerelease step on `master`
filters:
Expand All @@ -194,11 +194,14 @@ workflows:
context: gravitee-qa
requires:
- build
- lint-test
- dangerjs
- trigger-chromatic:
type: approval
requires:
- build
- lint-test
- dangerjs
# Ignore this manual step and trigger chromatic automatically on `master`
filters:
branches:
Expand Down
27 changes: 15 additions & 12 deletions dangerfile.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
import { danger, markdown } from 'danger';
import { danger, markdown, fail, schedule } 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');
schedule(new Promise(resolve => {
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.
There is some untracked files after \`npm run build\` command.
Some components are based on third party libraries, for integration into a web component, we extract the css from its libraries as assets.
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 ?
`);
}
}
resolve();
});
}));
37 changes: 37 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@
"pascal-case": "3.1.2",
"prettier": "2.4.1",
"semantic-release": "18.0.0",
"simple-git": "^2.47.0",
"sort-package-json": "1.52.0",
"svgo": "2.8.0",
"svgstore": "3.0.1",
Expand Down

0 comments on commit 9b9613d

Please sign in to comment.