jenkinsci / ghprb-plugin

github pull requests builder plugin for Jenkins
https://plugins.jenkins.io/ghprb/
MIT License
506 stars 612 forks source link

Publish multiple github-statuses from the same pipeline job #832

Open benipeled opened 2 years ago

benipeled commented 2 years ago

What feature do you want to see added?

Suppose I have the following pipeline

pipeline {
    agent any
    stages {
        stage ('Build') {
            /* some build steps here */
        }
        stage ('Test') {
            /* some test steps here */
        }
    }
}

I expect github-checks to look like this:

image

I saw that there is an option to do it by using several different jobs that would update the same PR but I see no reason (at least in my case) to split the tasks (build, test etc.) into different jobs and maintain them separately,

The pipeline-github plugin provides the pullRequest.createStatus function to publish the status during the run which is quite efficient and makes the status update more dynamic, example:

pullRequest.createStatus(
    status: 'success',
    context: 'Build',
    description: 'Build finished Successful',
    targetUrl: "${env.JOB_URL}/console"
)

With such an option, the user can update different statuses in the same pipeline

...and if you're wondering why I'm not using the pipeline-github plugin :) - because I prefer the simplicity of the ghprb-plugin which allows using one Job for all PRs in all branches in a given repository and doesn't create jobs for each PR in each Branch (as GitHub Branch Source plugin does which is required by the pipeline-github plugin)

Upstream changes

No response

heowc commented 1 year ago

đź‘Ť