From 73faf6d3e4b021471db7f2768cf2fbdd69055557 Mon Sep 17 00:00:00 2001 From: Yordis Prieto Date: Sun, 4 Feb 2024 23:24:08 -0500 Subject: [PATCH] chore: use latest tag to download file in makefile Signed-off-by: Yordis Prieto --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index bf9d9bd1..d1d1711d 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,10 @@ gen-changelog: npx auto-changelog --unreleased run-all: - curl -o ./priv/openapi/spec3.sdk.json https://raw.githubusercontent.com/stripe/openapi/master/openapi/spec3.sdk.json + @$(eval LATEST_TAG=$(shell curl -s https://api.github.com/repos/stripe/openapi/releases/latest | jq -r '.tag_name')) + @echo "Latest tag: $(LATEST_TAG)" + @echo "Downloading https://raw.githubusercontent.com/stripe/openapi/$(LATEST_TAG)/openapi/spec3.sdk.json to ./priv/openapi/spec3.sdk.json" + @curl -o ./priv/openapi/spec3.sdk.json https://raw.githubusercontent.com/stripe/openapi/$(LATEST_TAG)/openapi/spec3.sdk.json mix stripe.generate mix format SKIP_STRIPE_MOCK_RUN=true mix test