Skip to content

Commit 48350db

Browse files
fix: release-process enforce branch requirement for releases to be run only from master
1 parent f9e338c commit 48350db

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

docs/release-process.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# 🚀 How to release
22

3+
- Branch requirement: run releases only from the `master` branch. The script enforces this and exits otherwise.
4+
35
1. Run `./scripts/release <VERSION>` to create a new version
46
2. Go to GitHub Actions to monitor the build process
57
3. Once complete, update and publish the release on GitHub

scripts/release

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ if [ -z "$VERSION" ]; then
1010
exit 1
1111
fi
1212

13+
CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
14+
if [ "$CURRENT_BRANCH" != "master" ]; then
15+
echo "Error: Releases are only allowed from 'master' (current: '$CURRENT_BRANCH')"
16+
exit 1
17+
fi
18+
1319
node ./scripts/version-bump.js "$VERSION"
1420
if [ $? -ne 0 ]; then
1521
echo "Error: Version bump failed"

0 commit comments

Comments
 (0)