jenkinsci / jenkinsci/workflow-basic-steps-plugin

[JENKINS-73991] withEnv does not alert when env var name is not valid

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

Description

I mistakenly tried to setting an env var which is not valid in a linux environment, e.g. :

withEnv([

parallel-build='-j 12'
])

It is clearly not possible to create a linux env var with a variable name containing a dash.

The result is that the env var is not set, If some other env var are set in withEnv, they are not set and the pipeline can goes on without any warning.

There should have at least a warning written in the console log, and I think that as environment variables can be considered as critical data for a pipeline, the pipeline should be stopped.

---
Originally reported by jielpe_fr38, imported from: withEnv does not alert when env var name is not valid


  • status: Open
  • priority: Minor
  • component(s): workflow-basic-steps-plugin
  • resolution: Unresolved
  • votes: 0
  • watchers: 2
  • imported: 20251215-220547

Raw content of original issue

I mistakenly tried to setting an env var which is not valid in a linux environment, e.g. :



withEnv([

parallel-build='-j 12'
])


It is clearly not possible to create a linux env var with a variable name containing a dash.

The result is that the env var is not set, If some other env var are set in withEnv, they are not set and the pipeline can goes on without any warning.

There should have at least a warning written in the console log, and I think that as environment variables can be considered as critical data for a pipeline, the pipeline should be stopped.

environment

```
Jenkins : 2.462.2 LTS (alpine based docker image)

workflow-basic-steps-plugin : 1058.vcb_fc1e3a_21a_9
```

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.