jenkinsci / pipeline-github-plugin

Pipeline: GitHub
https://plugins.jenkins.io/pipeline-github/
MIT License
159 stars 73 forks source link

Unable to merge Pull Request that has Jenkins pipeline as status check #112

Closed Yethal closed 1 year ago

Yethal commented 2 years ago

Jenkins and plugins versions report

not relevant

What Operating System are you using (both controller, and any agents involved in the problem)?

not relevant

Reproduction steps

  1. Create github repo with Jenkins pipeline as required status check
  2. Add Jenkins pipeline to the repo
  3. In post success block of the pipeline add pullRequest.merge step
  4. Run the pipeline

Expected Results

Pull request gets merged if all pipeline steps were successful

Actual Results

Merge fails because required status check Jenkins is still pending. The problem here is that the api call that sets the status of the Jenkins check is sent after the entire pipeline has been completed and not after all stages have been completed but before the post block kicks in.

Anything else?

No response

aaronwalker commented 1 year ago

@Yethal This plugin doesn't handle that particular jenkins status check. So if you attempt merge the PR within a stage that has a rule requiring this check it will fail. It's annoying a workaround is to add your own status check that you control in your own pipeline and remove the branch rule that requires that status check.