jenkinsci / jenkinsci/git-plugin

[JENKINS-29394] Need to manually run jobs on specific branches AND be triggered by commits in any others

Open
#2,686 1 comment 0 reactions 0 assignees View on GitHub
component:git-plugin enhancement imported-jira-issue priority:minor resolution:unresolved
Dominant language
Java
Stars
694
Forks
1.1k
Avg merge
1h 29m
Merged PRs (30d)
3

Description

I have a maven project stored in Atlassian Stash and have "Branches to build" set blank so that it will respond to any commit in any branch when triggered by stash. This works great for the typical use case but periodically we need to release a version and so we want to use the maven release plugin on the master branch. When we hit "Perform maven release" the job is run using the last modified branch in the git repository rather than the master branch.

Configuring the job to have "Branches to build" set to master allows the maven release plugin to be run but then totally ignores commits to other branches that should be triggering the job.

I've even tried using a BranchToCheckout build parameter defaulting to ** so that it defaults to any branch but maven releases can be run specifically on master (or other release branches) but this ignores other commits too.

Is this a supported feature combination and I just need help getting the config right? Or is this an entirely novel requirement?

---
Originally reported by roxspring, imported from: Need to manually run jobs on specific branches AND be triggered by commits in any others


  • status: Open
  • priority: Minor
  • component(s): git-plugin
  • label(s): configuration, scm
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 2025-12-02

Raw content of original issue

I have a maven project stored in Atlassian Stash and have "Branches to build" set blank so that it will respond to any commit in any branch when triggered by stash. This works great for the typical use case but periodically we need to release a version and so we want to use the maven release plugin on the master branch. When we hit "Perform maven release" the job is run using the last modified branch in the git repository rather than the master branch.

Configuring the job to have "Branches to build" set to master allows the maven release plugin to be run but then totally ignores commits to other branches that should be triggering the job.

I've even tried using a BranchToCheckout build parameter defaulting to ** so that it defaults to any branch but maven releases can be run specifically on master (or other release branches) but this ignores other commits too.

Is this a supported feature combination and I just need help getting the config right? Or is this an entirely novel requirement?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.