From f68355a96611dbe07ce5a830766711f3ad284827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=A4felfinger?= Date: Thu, 3 Nov 2022 15:32:42 +0100 Subject: [PATCH] only publish packages on main branch --- Jenkinsfile | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a5a3001..755180b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,9 +40,12 @@ pipeline { } } - stage('nuget publish') { - steps { - sh "dotnet nuget push --source gitea ${env.WORKSPACE}/publish/*.nupkg" + // 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" + } } }