[chore] Makefile - Allow releasing also from release.* branches (#201)

Rationale: https://hub.mattermost.com/private-core/pl/yim6z9us9fdtfrjkdf8i16tczw
This commit is contained in:
Akis Maziotis 2024-06-07 13:44:29 +03:00 committed by GitHub
parent bd0e6f287b
commit 9805832b2f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -53,8 +53,8 @@ RC := $(shell echo $(CURRENT_VERSION) | grep -oE 'rc[0-9]+' | sed 's/rc//')
# Check if current branch is protected # Check if current branch is protected
define check_protected_branch define check_protected_branch
@current_branch=$$(git rev-parse --abbrev-ref HEAD); \ @current_branch=$$(git rev-parse --abbrev-ref HEAD); \
if ! echo "$(PROTECTED_BRANCH)" | grep -wq "$$current_branch"; then \ if ! echo "$(PROTECTED_BRANCH)" | grep -wq "$$current_branch" && ! echo "$$current_branch" | grep -q "^release"; then \
echo "Error: Tagging is only allowed from $(PROTECTED_BRANCH) branch. You are on $$current_branch branch."; \ echo "Error: Tagging is only allowed from $(PROTECTED_BRANCH) or release branches. You are on $$current_branch branch."; \
exit 1; \ exit 1; \
fi fi
endef endef