jenkinsci / jenkinsci/github-branch-source-plugin
[JENKINS-66821] Why are builds getting triggered when PR is closed?
- Dominant language
- Java
- Stars
- 217
- Forks
- 398
- Avg merge
- 30m
- Merged PRs (30d)
- 1
Description
We're setting up Jenkins to automatically build when new PRs are opened or updated. This is working great, but we've noticed that builds also happen when PRs are closed.
Is this something we can disable? If a developer closes a PR, there's no need for us to waste any time doing a build.
I believe this is the relevant code of the `github-branch-source-plugin` plugin: https://github.com/jenkinsci/github-branch-source-plugin/blob/923184ce70fc84252937b8d08872f666efcc288b/src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestGHEventSubscriber.java#L146-L154. Here you can see a `SCMEvent.Type.REMOVED` event getting fired. It's unclear to me what actually reacts to that event and triggers a build, though.
Any help would be super appreciated. Thanks!
---
Originally reported by jfly, imported from: Why are builds getting triggered when PR is closed?
Raw content of original issue
We're setting up Jenkins to automatically build when new PRs are opened or updated. This is working great, but we've noticed that builds also happen when PRs are closed.
Is this something we can disable? If a developer closes a PR, there's no need for us to waste any time doing a build.
I believe this is the relevant code of the `github-branch-source-plugin` plugin: https://github.com/jenkinsci/github-branch-source-plugin/blob/923184ce70fc84252937b8d08872f666efcc288b/src/main/java/org/jenkinsci/plugins/github_branch_source/PullRequestGHEventSubscriber.java#L146-L154. Here you can see a `SCMEvent.Type.REMOVED` event getting fired. It's unclear to me what actually reacts to that event and triggers a build, though.
Any help would be super appreciated. Thanks!
environment
```
Jenkins 2.303.1
GitHub Branch Source 2.11.2
```
Contributor guide
Assessment
This issue has not been assessed yet.