Skip to content

Commit

Permalink
chore(release): format changelogs during CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ifiokjr committed Jan 17, 2020
1 parent 34993a1 commit 1c613f4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"generate:api": "node support/scripts/generate-api-docs.js --api",
"generate:docs": "node support/scripts/generate-api-docs.js --docs",
"generate:json": "node support/scripts/generate-configs.js",
"if-ci": "node support/scripts/run-if-ci.js",
"if-clean": "node support/scripts/run-if-clean.js",
"if-config": "node support/scripts/run-if-config.js",
"if-not-ci": "node support/scripts/run-if-not-ci.js",
Expand All @@ -52,6 +53,7 @@
"patch": "patch-package --patch-dir support/patches",
"prerelease": "yarn if-not-ci run-s checks:release",
"release": "changeset publish",
"postrelease": "yarn if-ci yarn prettier --write '**/CHANGELOG.md' ",
"size": "size-limit",
"start:checks": "cpy support/.config.sample.json ./ --rename=\".config.json\"",
"stop:checks": "rimraf ./.config.json",
Expand Down
12 changes: 12 additions & 0 deletions support/scripts/run-if-ci.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { execSync } = require('child_process');

const [, , ...args] = process.argv;
const command = args.join(' ');
const { CI } = process.env;

if (!CI || CI === 'false') {
console.log(`not 'CI' - skipping command: '${command}'\n\n`);
process.exit(0);
}

execSync(command, { stdio: 'inherit' });

0 comments on commit 1c613f4

Please sign in to comment.