action-gh-release icon indicating copy to clipboard operation
action-gh-release copied to clipboard

Tilde in filename gets substituted

Open tobwen opened this issue 4 years ago • 9 comments

issue

My filename looks like tobwen-1.1.0-1~buster_amd64.deb. When releasing it, the filename gets renamed to tobwen-1.1.0-1.buster_amd64.deb.

remark

The tilde ~ is allowed on URLs and all major OS and filesystems, like Linux, macOS and Windows.

question

Is this a restriction of action-gh-release or ob github?

tobwen avatar Sep 19 '21 05:09 tobwen

It seems to be a limitation of GitHub:

GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "List assets for a release" endpoint lists the renamed filenames. For more information and help, contact GitHub Support.

https://docs.github.com/en/rest/reference/repos#upload-a-release-asset

movermeyer avatar Oct 22 '21 12:10 movermeyer

I've found the same issue occurs with a colon (:) in a filename. It is also being substituted with a period (.), making GitHub Releases unsuitable for hosting Arch Linux repositories that define an epoch parameter in PKGBUILD.

benalexau avatar Nov 05 '21 23:11 benalexau

My assests are also having parentheses substituted with periods, which I know go through fine with manual uploads. I'd be somewhat surprised if those were considered "special characters", though the "non-alphanumeric" portion of the docs do suggest that could be possible. If so its quite silly that the endpoint would have limitation that the site UI doesn't.

The documentation could really be more specific, it basically just tells you to contact support. :/

oblivioncth avatar May 14 '22 11:05 oblivioncth

Perhaps also spaces? Files seem to get uploaded as artefacts with spaces in the titles (my title.exe) and then when downloading and running through the action comes out (my.title.exe). It's an accepted character by GitHub, any reason for the substitution?

maggie44 avatar Feb 01 '23 18:02 maggie44

Perhaps also spaces?

Yeah, I'm also surprised that my spaces get converted to dots -> destroying the file names………

MacDada avatar Jun 14 '23 13:06 MacDada

Hi

I also faced this issue where space are replaced by dot. It's break many things on our side. An update for this is possible/planned ?

Thanks

parnaudd avatar Sep 20 '23 13:09 parnaudd

Same here with parentheses. Is this GitHub restriction?

kid1412621 avatar May 09 '24 09:05 kid1412621

This was noted in a recent pull request that relaxed the handling of names with spaces https://github.com/softprops/action-gh-release/pull/446#discussion_r1591023630

GitHub doesn't expressly document which characters may get replaced in its documentation but it does document some.

GitHub renames asset filenames that have special characters, non-alphanumeric characters, and leading or trailing periods. The "List release assets" endpoint lists the renamed filenames. For more information and help, contact GitHub Support.

softprops avatar May 09 '24 15:05 softprops

One possible work around for now is to create an a archive whose name does not contain special characters that contains the file with special characters in its names and use that archive as the release asset. that allows your users to download a and then unpack a artifact containing files with names without GitHub's restrictions.

softprops avatar May 09 '24 15:05 softprops