No pattern option for buildkite-agent artifact upload

I’ve had to update one of my pipelines due to ‘~’ taking on a special meaning and breaking uploads of artifacts with it in their filename, it would be nice if there was a --no-pattern or --literal option to make filenames be interpreted literally.

Error appearing after update:

buildkite-agent: fatal: failed to upload artifacts: collecting artifacts: invalid glob pattern "./ubuntu/questing/amd64/rehex_0.63.3-0~ubuntu2510_amd64.changes": invalid punctuation �

Original command in pipeline:

(cd debian/build/ && find -type f -exec buildkite-agent artifact upload {} \;)

New command in pipeline:

(cd debian/build/ && find -type f -print0 | sed -Ee 's/([]?*{}~[])/\\\1/g' | xargs -0 -L 1 -- buildkite-agent artifact upload)

Obviously this work-around will need updating in the future if/when the glob syntax changes again.

Hey @solemnwarning,

Thanks for raising this – taking a bit of a deep-dive into this, it looks like this is a regression introduced by switching libraries from go-zglob to zz-glob in this PR here.

This was introduced as part of Agent version 3.104.0. As such, we’ve raised this to the Agent Team in this GitHub issue here.

In the meantime, your solution is working as intended, which is great. Another workaround for this would be using an Agent version lower than 3.104.0, we can see that you were previously using 3.103.1 – this should continue to work on that Agent version as intended.

We’d suggest following the GitHub Issue previously mentioned, so that you get regular updates on this from the team.