From aa6929e3a0cbe112e7e75ee5e22079272e9479da Mon Sep 17 00:00:00 2001 From: Shalin Patel Date: Thu, 19 Sep 2024 10:00:31 -0700 Subject: [PATCH] ci: use filter to exclued non release branches --- make/dev.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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)"