Sign in

Search issue titles and bodies, change requests and comments. Private repositories you cannot read are not included.

vole
Site
Clone

Read only, no credentials:

https://rodent.software/vole.git

Write over SSH with a registered key:

git clone ssh://git@rodent.software/vole.git

Self-hosted forge that lives in your Git repo.

Publish a directory declaration as a tree

4f8a3da8f7801735ab7ab719b3fda3f39cb7e070 · Keenan Nemetz · 19d ago · parent 5f2a0b0a

Publish a directory declaration as a tree

A workflow artifact path with no glob that names a directory now publishes every
regular file under it, relative to that directory. `dist` gives
`apt/Packages` and `yum/repodata/repomd.xml`; `dist/apt` gives `Packages`. A
glob keeps the static-root rule, and `.` is refused so a declaration cannot
accidentally publish the whole checkout.

This matches `vole release attach <tag> <dir>` and removes the need for
depth-specific globs or a staging copy when a build already has a package tree.

Refs: 01M7BPH6RRPK2934FCHVJPQNGY

ci/validate.go +7−5

@@ -117,22 +117,24 @@ func ValidRefName(name string) bool {
117 117 // be one a shell and a container runtime both accept.
118 118 func ValidEnvName(name string) bool { return envNameRE.MatchString(name) }
119 119
120 // ValidateArtifactPath reports why p is not a usable artifact pattern. A pattern is
121 // relative to the checkout, names files rather than a directory, and cannot climb
122 // out of the tree; the runner expands it, so this is the check that decides what it
123 // is allowed to expand.
120 // ValidateArtifactPath reports why p is not a usable artifact declaration. A
121 // declaration is relative to the checkout, may name a file, a directory, or a
122 // glob, and cannot climb out of the tree; the runner expands it, so this is the
123 // check that decides what it is allowed to expand.
124 124 func ValidateArtifactPath(p string) error {
125 125 switch {
126 126 case p == "":
127 127 return fmt.Errorf("path is required (a glob relative to the checkout, e.g. dist/*)")
128 128 case len(p) > MaxArtifactPathBytes:
129 129 return fmt.Errorf("path is %d bytes, limit %d", len(p), MaxArtifactPathBytes)
130 case p == ".":
131 return fmt.Errorf("%q is the checkout root; name the directory that holds the outputs", p)
130 132 case strings.HasPrefix(p, "/") || filepath.IsAbs(p):
131 133 return fmt.Errorf("%q must be relative to the checkout", p)
132 134 case strings.Contains("/"+p+"/", "/../") || p == "..":
133 135 return fmt.Errorf("%q climbs out of the checkout", p)
134 136 case strings.HasSuffix(p, "/"):
135 return fmt.Errorf("%q names a directory; declare the files, e.g. %s*", p, p)
137 return fmt.Errorf("%q has a trailing slash; write the directory as %s", p, strings.TrimSuffix(p, "/"))
136 138 case strings.Contains(p, "**"):
137 139 return fmt.Errorf("%q uses **, which does not mean what it does elsewhere; use %s*",
138 140 p, strings.SplitN(p, "**", 2)[0])