Fix (not use getRawBuild)
Some checks reported errors
andreas-personal/AndysAdguardHomeBlockList/pipeline/head Something is wrong with the build of this commit

This commit is contained in:
Andreas Fahrecker 2024-04-10 18:57:22 +02:00
parent b8c9fe5357
commit 7f4e0931f0

5
Jenkinsfile vendored
View File

@ -24,8 +24,9 @@ pipeline {
}
steps {
script {
def causedByScmEvent = currentBuild.rawBuild.getCause(hudson.triggers.SCMTrigger.SCMTriggerCause)
if (causedByScmEvent == null) {
def causes = currentBuild.getBuildCauses()
def causedByScmEvent = causes.any { it._class == 'hudson.triggers.SCMTrigger$SCMTriggerCause' }
if (!causedByScmEvent) {
echo 'Not triggered by SCM, continuing build'
} else if (sh(script: 'git log -1 --pretty=format:"%an"', returnStdout: true).trim() == 'Jenkins') {
currentBuild.result = 'ABORTED'