Github checks plugin: status checks not updating

Hello everyone,

I am trying to get a ‘Pipeline’ job to update the status Checks on Github using the ‘Github Checks plugin’ but I can’t seem to get it working. Intrestingly the initial generic update of the status works, but any followup status reports (fail, unstable, etc) does not make it to Github.

The pipeline uses an SSH/Key pair as credentials for the Git login. Looking at the code of the plugin, if I understand it correctly, the plugin uses the Git login to authenticate to Github for updating the status checks (github-checks-plugin/GitHubChecksPublisher.java at 569d5df33c8289b2ffc6488c830468d472cb4fc9 · jenkinsci/github-checks-plugin · GitHub).

This will fail (as expeced) with on the following error output:

2023-06-07 08:02:18.131+0000 [id=687]	WARNING	i.j.p.c.g.GitHubChecksPublisher#publish: Failed Publishing GitHub checks: ChecksDetails{name='Jenkins', detailsURL='null', status=COMPLETED, conclusion=FAILURE, startedAt=null, completedAt=null, output=null, actions=[]}
java.io.IOException: Unsupported credential type: com.cloudbees.jenkins.plugins.sshcredentials.impl.BasicSSHUserPrivateKey
	at org.jenkinsci.plugins.github_branch_source.Connector.connect(Connector.java:397)
	at io.jenkins.plugins.checks.github.GitHubChecksPublisher.publish(GitHubChecksPublisher.java:72)
	at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher.publish(BuildStatusChecksPublisher.java:64)
	at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher$JobCompletedListener.lambda$onCompleted$0(BuildStatusChecksPublisher.java:188)
	at java.base/java.util.Optional.ifPresent(Optional.java:183)
	at io.jenkins.plugins.checks.status.BuildStatusChecksPublisher$JobCompletedListener.onCompleted(BuildStatusChecksPublisher.java:188)
	at hudson.model.listeners.RunListener.lambda$fireCompleted$0(RunListener.java:207)
	at jenkins.util.Listeners.lambda$notify$0(Listeners.java:59)
	at jenkins.util.Listeners.notify(Listeners.java:67)
	at hudson.model.listeners.RunListener.fireCompleted(RunListener.java:205)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.finish(WorkflowRun.java:646)
	at org.jenkinsci.plugins.workflow.job.WorkflowRun.run(WorkflowRun.java:363)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:442)

Then I tried to use a ‘Github app’ credential for login, expecting the Checks plugin as well as the Git plugin could use it for authentication to Github.

With this credential I can pull the source code from Git, but will still get the same error from the checks plugin and the checks are not updated.

At this point I don’t know what else I could check/change? Does anyone have any tips for me? Where is the Checks plugin getting its credentials from? Is maybe the Checks plugin just not working with regular ‘Pipeline’ jobs?

Thanks a lot,
Thomas

1 Like