def createPR()

in jenkins-pipeline-shared-libraries/vars/githubscm.groovy [152:162]


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