jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-46124] EnvStep convert map to list

Open
#436 15 comments 0 reactions 0 assignees View on GitHub
component:workflow-basic-steps-plugin imported-jira-issue priority:major resolution:unresolved
Dominant language
Java
Stars
73
Forks
129
PR merge metrics
No merged PRs in 30d

Description

Currently EnvStep only accepts String array.

But it would be nice if it could accept Map too

and convert it to a String array.

Right now I have to do this in a shared library.

def call(Closure body) {

deleteDir()
def scmVars = checkout scm
def list = []
scmVars.each { k, v -> list << "${k}=${v}" }
withEnv(list) {
body()
}
}

 

 

---
Originally reported by casz, imported from: EnvStep convert map to list


  • assignee: jetersen
  • status: In Review
  • priority: Major
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 1
  • watchers: 4
  • imported: 20251215-220547

Raw content of original issue

Currently EnvStep only accepts String array.

But it would be nice if it could accept Map<String, String> too
and convert it to a String array.

Right now I have to do this in a shared library.



def call(Closure body) {

deleteDir()
def scmVars = checkout scm
def list = []
scmVars.each { k, v -> list << "${k}=${v}" }
withEnv(list) {
body()
}
}


 

 

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.