Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.

Alternative to hashed asset names #15

Closed
rhyst opened this issue Feb 21, 2020 · 4 comments
Closed

Alternative to hashed asset names #15

rhyst opened this issue Feb 21, 2020 · 4 comments

Comments

@rhyst
Copy link

rhyst commented Feb 21, 2020

Hey, I'm using your automatic-releases action. I'm using it with the tag set to latest so it replaces the release and I notice that uploads quite often fail with:

(Validation Failed: {"resource":"ReleaseAsset","code":"already_exists","field":"name"})

This seems quite common (it happens with this https://github.com/actions/upload-release-asset too).

Your current solution is to add a hash to the filename which works however I want to be able to access the release assets at a known url so it would be better if they uploaded with their original name.

Do you know why this error happens and if there is a way to upload with the same name?

Thanks for any response and thanks for making the action.

@marvinpinto
Copy link
Owner

Hey! The hashed assets thing is a tough one. I suspect the storage mechanism used for assets is something like a plain old key-value store (similar to S3), except without the folder/directory abstraction. This means that trying to upload the file foo/index.js and bar/index.js will result in a filename that clashes. You can see an example of this on the releases page.

One thing you could do to work around this is make sure that your assets each have a unique filename before the action runs. That way you should be able to get a hold of them at a known URL.

@rhyst
Copy link
Author

rhyst commented Feb 24, 2020

I think I misinterpreted what the hashed file names were for.

My filenames are unique and it seems like the assets from the deleted (to be replaced) release were hanging around in some format or cache somewhere. I assumed the hashed filenames were to deal with this, but it seems like you were solving the different problem of legitimately clashing names (from different dirs like you say).

Have you seen the issue I am describing? Possibly not if you are creating tagged releases and not just replacing the same one (my repo is not producing anything builds that need versioning).

@marvinpinto
Copy link
Owner

Hmm yeah I have not noticed an issue with cached files from previous tagged releases. Not sure why either. The only thing I can think of is try deleting all the files in the previous release or the entire (tagged) release itself before creating a new release with the same name.

@marvinpinto
Copy link
Owner

I'm going to close this for now but feel free to re-open if there's anything outstanding 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants