What are the renaming rules for files in GitHub Releases?

Files in Releases are renamed if they include special characters.

As a minimal example, in this release I have attached a single file named test~file!!!. Something has renamed this file, replacing the ~ with . and removing the !!! (test~file!!!test.file). This happens when I upload a file with this name. If I then try to edit the filename in Edit release it shows no error but does an even stranger rename (test~file!!!test.file.file).

The motivation here was trying to upload a Debian package, which commonly has semantic tildes in the filename (my-proj_1.0.0~rc1.deb), and finding it surprisingly renamed (breaking a later container-building Action that expected the original name).

What characters are not allowed in these filenames?
Which are removed, and which are renamed?
Where is this documented?
Can these restrictions be removed?

Bumping this thread after 2 weeks with no response.

We hit this restriction as well with brackets ([]) in the uploaded file name.

This is particularly annoying because the file we’re trying to upload has to have a name that matches a specific format or it will not import correctly into the tool that consumes it. Hence every release has to come with a note to the effect of “Rename this file to this-format.file so that things work correctly” to work around seemingly-arbitrary restrictions enforced by GitHub.