Skip to content

Commit

Permalink
fix: trim space from git repo Url on create and update material (#4787)
Browse files Browse the repository at this point in the history
* trim space from workflow request to ci -runner

* remove trailing and leading spaces from url on create and update material

* use strings.TrimSpace directly
  • Loading branch information
Shivam-nagar23 authored Mar 13, 2024
1 parent 1426ad2 commit 1620bf3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/bean/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,12 @@ type GitMaterial struct {
FilterPattern []string `json:"filterPattern"`
}

// UpdateSanitisedGitRepoUrl will remove all trailing slashes from git repository url
// UpdateSanitisedGitRepoUrl will remove all trailing slashes , leading and trailing spaces from git repository url
func (m *GitMaterial) UpdateSanitisedGitRepoUrl() {
for strings.HasSuffix(m.Url, "/") {
m.Url = strings.TrimSuffix(m.Url, "/")
}
m.Url = strings.TrimSpace(m.Url)
}

type CiMaterial struct {
Expand Down

0 comments on commit 1620bf3

Please sign in to comment.