-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
evaluate env variables in git repo URI only when the value is available
- Loading branch information
1 parent
756497b
commit 0af1429
Showing
2 changed files
with
18 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,15 @@ class GitOperationsTest { | |
) | ||
assertThat(evaluatedGitRepositoryURI).isEqualTo("https://john:[email protected]/group/project.git") | ||
} | ||
|
||
@Test | ||
fun shouldNotEvaluatePatternsThatResembleEnvVarsWhenTheValueIsNotAvailable() { | ||
val gitRepositoryURI = "https://gitlab-ci-token:${'$'}{CI_JOB_TOKEN}@gitlab.com/group/${'$'}{do-not-eval}/project.git" | ||
val evaluatedGitRepositoryURI = | ||
evaluateEnvVariablesInGitRepoURI( | ||
gitRepositoryURI = gitRepositoryURI, | ||
mapOf("CI_JOB_TOKEN" to "token") | ||
) | ||
assertThat(evaluatedGitRepositoryURI).isEqualTo("https://gitlab-ci-token:[email protected]/group/${'$'}{do-not-eval}/project.git") | ||
} | ||
} |