diff --git a/make/dev.mk b/make/dev.mk index 742c028ff..9fd2d8421 100644 --- a/make/dev.mk +++ b/make/dev.mk @@ -45,7 +45,8 @@ dev.update-bootstrap-credentials-aws: .PHONY: release-please release-please: -ifneq ($(shell [[ "$(GIT_CURRENT_BRANCH)" = "main" ]] || [[ "$(GIT_CURRENT_BRANCH)" == release/v* ]]; echo $$?),0) +# filter Returns all whitespace-separated words in text that do match any of the pattern words. +ifeq ($(filter main release/v%,$(GIT_CURRENT_BRANCH)),) $(error "release-please should only be run on the main or release branch") else release-please release-pr --repo-url $(GITHUB_ORG)/$(GITHUB_REPOSITORY) --target-branch $(GIT_CURRENT_BRANCH) --token "$$(gh auth token)"