[JENKINS-11219] endBuild needs to call perform to check if script should be run on head or not