Skip to content

Enhancement: Allow mapping ABORTED builds to SKIPPED check conclusion #331

Description

@dominykasvl

What feature do you want to see added?

Description

I am using the Checks API plugin in a Jenkins pipeline and running into an issue where an aborted build incorrectly reports a FAILURE status to GitHub instead of SKIPPED.

Context & Use Case

In our Jenkins pipeline, the first stage evaluates specific conditions to determine if the build should proceed. If the conditions are not met, we intentionally abort the pipeline using:

currentBuild.result = 'ABORTED'

We use this approach to signal that a job was skipped rather than failed.

The Problem

Currently, the Checks API plugin maps an ABORTED build to a CANCELED check conclusion:

else if (result.isBetterOrEqualTo(Result.ABORTED)) {
return ChecksConclusion.CANCELED;
}

When the Jenkins pipeline finishes after being aborted, the automatic final check is published with a FAILURE status.

I tried to manually override this by adding a publishChecks step in that first stage right before the pipeline ends:

publishChecks(
    name: 'Jenkins', 
    status: 'COMPLETED', 
    conclusion: 'SKIPPED', 
    title: 'Jenkins job', 
    summary: 'Job aborted'
)

While this manually published check triggers successfully during execution, it gets completely overwritten by the plugin's default finalization logic once the build fully completes, reverting the status back to FAILURE.

Question

Is it currently possible to configure the Jenkins Checks API plugin to map an ABORTED build status to a SKIPPED GitHub check conclusion? Alternatively, can we manually publish a check outcome from within the pipeline without the plugin overriding it once the build finishes?

If not, could this be considered as a feature request similarly to how it was done for UNSTABLE builds in Issue #46?

Upstream changes

No response

Are you interested in contributing this feature?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Enhancement.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions