Artifact download may try to write a file to the build directory
- Dominant language
- Go
- Stars
- 1.1k
- Forks
- 378
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 74
Description
If an artifact is downloaded, and the artifact’s name is the same as the name of the build directory, the Agent will attempt to save the artifact over the directory, and will fail because the destination path is a directory.
This is because of this code: https://github.com/buildkite/agent/blob/fe3f98124caaac5f38961625f2b978526a72442d/agent/download.go#L48-L69 and appears to have been the case for all versions of the agent.
For clarity, the example case is:
Pipeline build folder: `buildkite/builds/my-agent-1/my-organisation-1/pipeline-name`
Artifact name: `pipeline-name`
Artifact download command: `buildkite-agent artifact download pipeline-name .`
Given that this behaviour is intended to be helpful, and in many cases is likely being used as intended, it might be best to simply disallow this behaviour for artifacts whose names have no directories in them.
Contributor guide
Assessment
This issue has not been assessed yet.