jenkinsci / jenkinsci/git-plugin

[JENKINS-56107] GIT_BRANCH sometimes is not populated

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

Description

For some reason some builds (maven job) doesn't populate `${GIT_BRANCH}`

I haven't found any pattern to this - my only suspicion would be "build strategy" that sometimes selects non-master branch (solution to problem with simply building all branches from https://issues.jenkins-ci.org/browse/JENKINS-11337)

---
Originally reported by wojtek, imported from: GIT_BRANCH sometimes is not populated


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

Raw content of original issue

For some reason some builds (maven job) doesn't populate `${GIT_BRANCH}`
I haven't found any pattern to this - my only suspicion would be "build strategy" that sometimes selects non-master branch (solution to problem with simply building all branches from https://issues.jenkins-ci.org/browse/JENKINS-11337)

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.