From 9a05dd2ebe549ea15bb164b6adf91705265706de Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 4 Nov 2024 09:22:19 +0100 Subject: [PATCH] github-actions: fixes gh command not found (#14484) (cherry picked from commit 9c7439f30167dcd7d4bd44e0473b0f249ce5fa8d) --- release.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/release.mk b/release.mk index 9e83e9f584c..9db2b3b8d40 100644 --- a/release.mk +++ b/release.mk @@ -39,12 +39,14 @@ PROJECT_PATCH_VERSION ?= $(shell echo $(RELEASE_VERSION) | cut -f3 -d.) PROJECT_OWNER ?= elastic RELEASE_TYPE ?= minor +# if gh is installed only +ifneq ($(shell command -v gh 2>/dev/null),) CURRENT_RELEASE ?= $(shell gh release list --exclude-drafts --exclude-pre-releases --repo elastic/apm-server --limit 10 --json tagName --jq '.[].tagName|select(. | startswith("v$(PROJECT_MAJOR_VERSION)"))' | sed 's|v||g' | sort -r | head -n 1) RELEASE_BRANCH ?= $(PROJECT_MAJOR_VERSION).$(PROJECT_MINOR_VERSION) NEXT_PROJECT_MINOR_VERSION ?= $(PROJECT_MAJOR_VERSION).$(shell expr $(PROJECT_MINOR_VERSION) + 1).0 NEXT_RELEASE ?= $(RELEASE_BRANCH).$(shell expr $(PROJECT_PATCH_VERSION) + 1) - BRANCH_PATCH = update-$(NEXT_RELEASE) +endif # for the view commits # as long as 8.x is the branch to run releases, then the base branch is 8.x