Skip to content

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

@benipeled

Description

@benipeled

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions