Skip to content

Commit c85404d

Browse files
authored
Merge pull request #110 from jeffret-b/documentQuotes
Highlight importance of using single-quotes.
2 parents f1c7b3b + 849ce76 commit c85404d

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ withCredentials([usernamePassword(credentialsId: 'amazon', usernameVariable: 'US
4343
}
4444
```
4545

46+
#### Note
47+
48+
You should use a single quote (`'`) instead of a double quote (`"`) whenever you can.
49+
This is particularly important in Pipelines where a statement may be interpreted by both the Pipeline engine and an external interpreter, such as a Unix shell (`sh`) or Windows Command (`bat`) or Powershell (`ps`).
50+
This reduces complications with password masking and command processing.
51+
The first step in the above example properly demonstrates this.
52+
The next two steps use the basic Pipeline `echo` step.
53+
The first one references the Groovy variable and needs no quotes.
54+
The second one needs to use double quotes, so that the interpolation is performed in Groovy.
55+
56+
For more information, see the Pipeline step reference for [Credentials Binding Plugin](https://www.jenkins.io/doc/pipeline/steps/credentials-binding/).
57+
4658
## Changelog
4759

4860
See [GitHub Releases](https://github.com/jenkinsci/credentials-binding-plugin/releases) for new releases,

0 commit comments

Comments
 (0)