jenkinsci / jenkinsci/git-plugin

[JENKINS-29689] Some environment variables are not expanded during git polling

Open
#2,694 4 comments 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

When setting the git URL to include environment variables, specifically

```
${JOB_NAME}

```

, and "Force polling using workspace" disabled, then during SCM polling the environment variables are not evaluated correctly when evaluating ref-specs and branch-specs.

As a result, credentials are loaded to the git client using the unparsed URL, while when the git client is actually being run it uses the correct URL and fails to load the credentials.

---
Originally reported by guss77, imported from: Some environment variables are not expanded during git polling


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

Raw content of original issue

When setting the git URL to include environment variables, specifically



${JOB_NAME}



, and "Force polling using workspace" disabled, then during SCM polling the environment variables are not evaluated correctly when evaluating ref-specs and branch-specs.

As a result, credentials are loaded to the git client using the unparsed URL, while when the git client is actually being run it uses the correct URL and fails to load the credentials.

environment

```
OS: Ubuntu 14.04 64bit, Jenkins running in a docker running Ubuntu 14.04. Slaves running Ubuntu 14.04 64bit

Java: OpenJDK Runtime Environment (IcedTea 2.5.5) (7u79-2.5.5-0ubuntu0.14.04.2)

Jenkins version 1.620, running directly. Accessed through ELB

git-plugin version 2.4.0

git-client-plugin 1.18.0

```

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.