Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit cc50dfb

Browse files
author
Federico Zivolo
committed
build: Prevent publish from non master branch
1 parent 579e227 commit cc50dfb

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@
2828
"test:jest": "jest",
2929
"test:eslint": "eslint src",
3030
"prepare": "npm run build",
31-
"precommit": "pretty-quick --staged && test"
31+
"precommit": "pretty-quick --staged && test",
32+
"prepublish": "git-branch-is master"
3233
},
3334
"jest": {
3435
"setupTestFrameworkScriptFile": "<rootDir>jest.setup.js",
@@ -84,6 +85,7 @@
8485
"eslint-plugin-react": "^7.7.0",
8586
"flow-bin": "^0.69.0",
8687
"flow-copy-source": "^1.3.0",
88+
"git-branch-is": "^0.1.0",
8789
"jest": "^22.4.3",
8890
"outy": "^0.1.2",
8991
"parcel-bundler": "^1.6.2",

yarn.lock

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2940,6 +2940,12 @@ getpass@^0.1.1:
29402940
dependencies:
29412941
assert-plus "^1.0.0"
29422942

2943+
git-branch-is@^0.1.0:
2944+
version "0.1.0"
2945+
resolved "https://registry.yarnpkg.com/git-branch-is/-/git-branch-is-0.1.0.tgz#bef5a6113a30f4007e7c002f9ba4cf37925c171f"
2946+
dependencies:
2947+
commander "^2.9.0"
2948+
29432949
glob-base@^0.3.0:
29442950
version "0.3.0"
29452951
resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"

0 commit comments

Comments
 (0)