Skip to content

Instantly share code, notes, and snippets.

@michalskalski
michalskalski / JENKINS-28447.workaround.groovy
Created July 9, 2020 13:52 — forked from kad/JENKINS-28447.workaround.groovy
workaround for JENKINS-28447 in case of github trigger plugin.
// Reconfigure job to have Pipeline DSL configured inside job, instead of from scm.
// Put snippet below to pipeline text box
// Define additional job parameters:
// GITHUB_PROJECT: string, URL to your GitHub repository
// GITHUB_AUTH: string, credentials ID to use in case of private GitHub repository
node {
dir('pipeline_handover') {
checkout([$class: 'GitSCM',
branches: [[name: "origin-pull/$GITHUB_PR_NUMBER/$GITHUB_PR_COND_REF"]],
doGenerateSubmoduleConfigurations: false,