From f6ea1f0a5a712878e3d7fe2a418b2fe60f771b8e Mon Sep 17 00:00:00 2001 From: Carl Whittaker Date: Tue, 27 Feb 2024 14:58:19 +0000 Subject: [PATCH] chore: skip pre-commit hooks when creating a release --- .github/workflows/release.yml | 2 ++ package.json | 1 - scripts/prepublish.sh | 5 +++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a1638065..ebdaf871 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,4 +35,6 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + HUSKY: 0 + CI: true run: npx semantic-release diff --git a/package.json b/package.json index 186c7cc7..6cb3fdb8 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,6 @@ "build-storybook": "storybook build", "prepare": "husky install", "prepublishOnly": "./scripts/prepublish.sh", - "postpublish": "./scripts/postpublish.sh", "publish:local": "npm run build && yalc publish --no-scripts" }, "author": "", diff --git a/scripts/prepublish.sh b/scripts/prepublish.sh index 0916529f..1d1a5827 100755 --- a/scripts/prepublish.sh +++ b/scripts/prepublish.sh @@ -2,6 +2,11 @@ echo "pre-publish" +if [ "$CI" = "true" ]; then + echo "Skipping pre-publish checks on CI" + exit 0 +fi; + branch="$(git rev-parse --abbrev-ref HEAD)" if [ "$branch" != "main" ]; then