From 9d92b6858a64acf0a38c57a75ccde8bc149f979a Mon Sep 17 00:00:00 2001 From: Sebastian Mark Date: Fri, 8 Nov 2024 16:00:57 +0100 Subject: [PATCH] limit git tasks to main branch --- Taskfile.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Taskfile.yml b/Taskfile.yml index ba0bef3..d6f413e 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -5,13 +5,19 @@ vars: sh: svu next --strip-prefix VERSIONFILE: version.txt COMMITMSG: "chore: bump version to v{{.RELEASE}}" + CURRENTBRANCH: + sh: git branch --show-current tasks: release:tag: + preconditions: + - test {{.CURRENTBRANCH}} == "main" cmds: - git tag v{{.RELEASE}} release:file: + preconditions: + - test {{.CURRENTBRANCH}} == "main" cmds: - echo {{.RELEASE}} >{{.VERSIONFILE}} - git add {{.VERSIONFILE}}