Fix (not use getRawBuild)
Some checks reported errors
andreas-personal/AndysAdguardHomeBlockList/pipeline/head Something is wrong with the build of this commit
Some checks reported errors
andreas-personal/AndysAdguardHomeBlockList/pipeline/head Something is wrong with the build of this commit
This commit is contained in:
parent
b8c9fe5357
commit
7f4e0931f0
5
Jenkinsfile
vendored
5
Jenkinsfile
vendored
@ -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'
|
||||
|
Reference in New Issue
Block a user