From a8890dc20d4427d42ac0bb350891e79464a264f6 Mon Sep 17 00:00:00 2001 From: Samuel Cattini-Schultz Date: Sat, 18 May 2024 23:49:07 +1000 Subject: [PATCH] Ensure releases can only occur on master --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index a1d8c71..1c23aea 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,9 @@ ifndef GITHUB_PAT endif ifndef GITHUB_USERNAME $(error GITHUB_USERNAME env var is not set) +endif +ifneq "$(shell git branch --show-current)" "master" + $(error This command can only be run on the master branch) endif echo $$GITHUB_PAT | docker login ghcr.io --username $$GITHUB_USERNAME --password-stdin VERSION=$(VERSION) $(COMPOSE_PUBLISH) build