From 3258ddfdcb369fcebbbbde98e9c4f10cdd2f6e88 Mon Sep 17 00:00:00 2001 From: dhurley Date: Wed, 6 Sep 2023 17:23:15 +0100 Subject: [PATCH] In the Makefile, if no git tags are found then query the github api instead to get latest tag. --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 8142df806e..4560975cf0 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,9 @@ # Variable Definitions # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # VERSION = $(shell git describe --match "v[0-9]*" --abbrev=0 --tags) +ifeq ($(VERSION),) + VERSION = $(shell curl https://api.github.com/repos/nginx/agent/releases/latest -s | jq .name -r) +endif COMMIT = $(shell git rev-parse --short HEAD) DATE = $(shell date +%F_%H-%M-%S)