You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Paths in some workflows and tasks are configured via variables. Previously, when a value specified a folder path, a
trailing slash was added. The intent behind this was to make it slightly more clear that the value was referring to a
folder (e.g., `./` vs. `.`). However, this practice can be harmful in the case where the value is used as a base
component in a path, as then it is most appropriate to omit the path separator in the concatenation code, which is at
all clear (e.g., `FOO_PATH: foo/`, `{{.FOO_PATH}}bar` -> `foo/bar`). And if the separator is used in the concatenation
code, it results in a confusing double separator in the resulting path (e.g., `FOO_PATH: foo/`, `{{.FOO_PATH}}/bar` ->
`foo//bar`). The benefit of the trailing slash on the variable definition is miniscule at most, since the variable name,
documentation, and other context should make it obvious that the value is a folder path. So the harm of this approach
outweighs the benefit.
For this reason, it is better to omit the trailing slash in the variable definition (e.g., `FOO_PATH: foo`,
`{{.FOO_PATH}}/bar` -> `foo/bar`). Even though this approach is not relevant in cases where the path is not used as a
base component, it is best to be consistent in this practice.
0 commit comments