def createPrAsDraft()

in jenkins-pipeline-shared-libraries/vars/githubscm.groovy [164:174]


def createPrAsDraft(String pullRequestTitle, String pullRequestBody = '', String targetBranch = 'main', String credentialID = 'kie-ci') {
    def pullRequestLink
    try {
        pullRequestLink = executeGHCli("gh pr create -d -t '${pullRequestTitle}' -b '${pullRequestBody}' -B '${targetBranch}'", credentialID)
    } catch (Exception e) {
        println "[ERROR] Unable to create Draft PR. Please make sure the targetBranch ${targetBranch} is correct."
        throw e
    }
    println "Please see the created Draft PR at: ${pullRequestLink}"
    return pullRequestLink
}