diff --git a/.circleci/config.yml b/.circleci/config.yml index b507ac021..d6e6c468b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -171,6 +171,9 @@ workflows: - lint-test: requires: - install + - build: + requires: + - install - dangerjs: pre-steps: - secrethub/env-export: @@ -178,10 +181,7 @@ workflows: var-name: DANGER_GITHUB_API_TOKEN context: gravitee-qa requires: - - install - - build: - requires: - - install + - build - prerelease: # Ignore this prerelease step on `master` filters: @@ -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: diff --git a/dangerfile.ts b/dangerfile.ts index e9d94f9db..ef50d0e0f 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -1,10 +1,12 @@ -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! @@ -12,16 +14,17 @@ Also, after merging this PR, you should update the \`definition.json\` of [APIM `); } -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(); + }); +})); diff --git a/package-lock.json b/package-lock.json index 6cd94c342..ba7fccc65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7247,6 +7247,21 @@ } } }, + "@kwsites/file-exists": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/file-exists/-/file-exists-1.1.1.tgz", + "integrity": "sha512-m9/5YGR18lIwxSFDwfE3oA7bWuq9kdau6ugN4H2rJeyhFQZcG9AgSHkQtSD15a8WvTgfz9aikZMrKPHvbpqFiw==", + "dev": true, + "requires": { + "debug": "^4.1.1" + } + }, + "@kwsites/promise-deferred": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@kwsites/promise-deferred/-/promise-deferred-1.1.1.tgz", + "integrity": "sha512-GaHYm+c0O9MjZRu0ongGBRbinu8gVAMd2UZjji6jVmqKtZluZnptXGWhz1E8j8D2HJ3f/yMxKAUC0b+57wncIw==", + "dev": true + }, "@mdx-js/loader": { "version": "1.6.22", "resolved": "https://registry.npmjs.org/@mdx-js/loader/-/loader-1.6.22.tgz", @@ -29235,6 +29250,28 @@ } } }, + "simple-git": { + "version": "2.47.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-2.47.0.tgz", + "integrity": "sha512-+HfCpqPBEZTPWiW9fPdbiPJDslM22MLqrktfzNKyI2pWaJa6DhfNVx4Mds04KZzVv5vjC9/ksw3y5gVf8ECWDg==", + "dev": true, + "requires": { + "@kwsites/file-exists": "^1.1.1", + "@kwsites/promise-deferred": "^1.1.1", + "debug": "^4.3.2" + }, + "dependencies": { + "debug": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.2.tgz", + "integrity": "sha512-mOp8wKcvj7XxC78zLgw/ZA+6TSgkoE2C/ienthhRD298T7UNwAg9diBpLRxC0mOezLl4B0xV7M0cCO6P/O0Xhw==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } + } + }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", diff --git a/package.json b/package.json index 98228f822..1ec68b112 100644 --- a/package.json +++ b/package.json @@ -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",