From a221ed2dbbb88cbf2bf70011c7ebce1a8ee4e16f Mon Sep 17 00:00:00 2001 From: Samuel Cattini-Schultz Date: Tue, 29 Oct 2024 18:58:39 +1100 Subject: [PATCH] Add release guardrail against uncommitted changes --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index 481a95c..43452bb 100644 --- a/Makefile +++ b/Makefile @@ -53,6 +53,9 @@ ifndef GITHUB_USERNAME endif ifneq "$(shell git branch --show-current)" "master" $(error This command can only be run on the master branch) +endif +ifneq "$(shell git diff --name-only master)" "" + $(error There are uncommitted changes in the working directory) endif echo $$GITHUB_PAT | docker login ghcr.io --username $$GITHUB_USERNAME --password-stdin VERSION=$(VERSION) $(COMPOSE_PUBLISH) build