Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Artifacts cannot be uploaded with commas in their filename? #322

Open
gerph opened this issue Apr 9, 2023 · 4 comments
Open

Artifacts cannot be uploaded with commas in their filename? #322

gerph opened this issue Apr 9, 2023 · 4 comments

Comments

@gerph
Copy link

gerph commented Apr 9, 2023

Describe the bug

The documentation for the artifacts field states that the artifacts are a comma-separated list of files that should be uploaded as artifacts of the release. This means that filenames which contain a comma cannot be uploaded. Filenames with commas are expected for RISC OS releases, as they use the form <filename>,<filetype>. So for example, an HTML file (which has the filetype number 0xFAF) would be named index,faf. Such a file would be unable to be released.

To Reproduce

Reading the documentation. I've used some repositories that required the use of multiple artifacts and I was forced to use the comma form, which raised this as a problem I will encounter.

Expected behavior

Unclear how this can be addressed. Ideally, you would allow the artifacts value to be a list of filenames to upload, which would avoid the delimiting issue. However, I'm not sure whether that's actually allowed for actions - it's possible that action values must be simple.

Alternatively, space-separated filenames could be used instead of comma-separated. But that would obviously preclude filenames with spaces in. Or maybe a | separated list of filenames, as | is rarely used in filenames.

Given that the former option is probably not technically possible, and the latter option is fiddly and breaks compatibility, a possible solution might be to allow the separator to be specified explicitly. Having a artifactsSeparator key which defaults to , would retain the current format, but allow anyone who needs more control to allow commas in their artifact names by changing the separator to a character or sequence which isn't used.

Screenshots
N/A

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
None.

@pboushy
Copy link

pboushy commented Aug 2, 2023

I investigated something similar to this a while back and chose to use a JSON array of strings encoded as a string.
Because all github runners include jq it makes it pretty easy to parse, and also allows virtually any characters.

Only disadvantage is escaping a JSON array as a string properly can be tricky.

@Hipska
Copy link

Hipska commented Sep 11, 2023

Other actions use multiline text to input multiple files..

It could become like this:

with:
  artifacts: |
    file1.zip
    file_with_,_comma.zip

@Weiberle17
Copy link

I am not sure if this should be it's own issue, but it seems like the "artifacts:" option does not allow variables.
$FILE_NAME gives out a warning saying file $FILE_NAME couldn't be found.
Maybe @Hipska's comment would also fix this.

@sburton84
Copy link

$FILE_NAME gives out a warning saying file $FILE_NAME couldn't be found.

Can you not access the Github environment variables using syntax like ${{ env.FILE_NAME }}? Syntax like $FILE_NAME would usually only be used for accessing environment variables within the run section, as it runs within a shell; I wouldn't expect that to work in any other sections.

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

No branches or pull requests

5 participants