Skip to content

Commit

Permalink
chore: add CI environment variables to release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
carlmw committed Feb 27, 2024
1 parent 468d0e1 commit 228a2d8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Release
on:
workflow_run:
workflows: Verify
branches: main
branches: [main, next]
types: completed

permissions:
Expand Down Expand Up @@ -35,4 +35,5 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
CI: true
run: npx semantic-release
6 changes: 4 additions & 2 deletions .husky/pre-push
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

git diff-index --quiet HEAD -- || (echo "Error: You have uncommitted changes. Please commit or stash them before pushing." && exit 1)
if [ "$CI" != "true" ]; then
git diff-index --quiet HEAD -- || (echo "Error: You have uncommitted changes. Please commit or stash them before pushing." && exit 1)
fi

branch="$(git rev-parse --abbrev-ref HEAD)"

if [ "$branch" = "main" ]; then
if [ "$CI" != "true" ] && [ "$branch" = "main" ]; then
echo "Main Branch push is blocked"
exit 1
fi
Expand Down

0 comments on commit 228a2d8

Please sign in to comment.