From bd812eceee122f87f46d98db503a9a7f184ad13e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=A4felfinger?= Date: Thu, 3 Nov 2022 16:02:46 +0100 Subject: [PATCH] fixes declarative when for nuget push --- Jenkinsfile | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 755180b..b07efeb 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,12 +40,11 @@ pipeline { } } - // we only publish packages for the main branch - if (env.BRANCH_NAME == 'main') { - stage('nuget publish') { - steps { - sh "dotnet nuget push --source gitea ${env.WORKSPACE}/publish/*.nupkg" - } + stage('nuget publish') { + // we only publish packages for the main branch + when { branch 'main' } + steps { + sh "dotnet nuget push --source gitea ${env.WORKSPACE}/publish/*.nupkg" } }