ghprb-plugin icon indicating copy to clipboard operation
ghprb-plugin copied to clipboard

Publish multiple github-statuses from the same pipeline job

Open benipeled opened this issue 3 years ago • 1 comments
trafficstars

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

benipeled avatar Feb 28 '22 13:02 benipeled

👍

heowc avatar Dec 16 '22 03:12 heowc