Hi guys, i have a pipeline configuration like the image attached. But I got multiple branch builds triggered when merge from master to release branch. Jenkins triggered master job and release job at the same time.

      1. I have 3 branches: master/release/production
      2. Configuration on jobs with pipeline
      3. Reproduce
        • create PR 1 to merge into master, then merge it
        • create PR 2 to merge into master
        • create PR 3 to merge from master to release
        • Jenkins will trigger 4 jobs: master/release/production/default with GHPR builder instead of trigger 1 job of PR 2

      What i expect:

      • Jenkins trigger only 1 job of PR2
      • After i merge PR2, Jenkins trigger the job of branch master
      • After i merge PR 3, Jenkins trigger the job of branch release

      Thank you

          [JENKINS-48359] Jenkins triggers wrong branch build.

          Hi tokio

          I had gone through your scenario. First two screen shots seems to be fine.

          In the third one you mentioned branch as ${sha1}, instead of that of you specify branch name as PR* it'll trigger the build for those specific branches starting with PR

          I hope this can fix issue.

          tulasinadh vaka added a comment - Hi tokio I had gone through your scenario. First two screen shots seems to be fine. In the third one you mentioned branch as ${sha1}, instead of that of you specify branch name as PR* it'll trigger the build for those specific branches starting with PR I hope this can fix issue.

            tokio Quang Huynh
            tokio Quang Huynh
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: