-
Notifications
You must be signed in to change notification settings - Fork 189
Dynamic Filenames (or an array?) #4
Comments
Hey @eduncan911 How does this example look as a way to pass in variable inputs:
|
Yep, that'll work for individual files. But again, we have 12 assets to upload. Any chance of accept an array? From my research, GitHub actions don't accept arrays as inputs. However, others have either used a single string with spaces or linebreaks to pass in, or a json array in a single '' string quote so it's treated as a string. Then split it up on the action side. |
I was working on a similar action before I found out about this. I took the following approaches for multiple files:
Because I didn't want to require I'd be happy to open a PR if the maintainers wanted this functionality. |
@csexton yep, that's exactly what I started to modify this action for. And to detect mime type per extension! |
here is an example https://github.com/meeDamian/github-release |
@csexton, in 1138-4EB/tip I use file-type to set https://github.com/1138-4EB/tip/blob/a7ad8ec4ef0d919ab02a6f72a507f54e1210a10a/ts/main.ts#L46-L82 You might want to review, reuse or discuss it. I believe that multiple actions will be written for similar tasks (e.g. yours, @wildone's, mine...). It'd be good if we could share best practices. |
I think the logic I put in to just take a simple, single file, and then parse the file-type is just that, very simple. I would love to implement functionality to determine mime type as well as take a pattern or list of assets. Originally, I figured a simple approach and (worse case) you can use the Action in 5 steps to upload 5 assets. I understand that isn't SUPER clean or ideal though, would love to see what y'all come up with! |
@IAmHughes The linked github action support multiple files and works really well. Unfortunately it is now deprecated and references to use this one. I changed the github workflow to use this one instead but it requires a lot of duplication. I believe it would be easy to submit a PR for multi-file support, in the same way the meeDamian action works. However I am concerned there are many PRs with improvements that are outstanding. Do you have any plans to improve this action or add other contributors to help with the PR backlog? |
@csexton I would be more than happy if you could provide a pr :) |
Hello!
So our build job generates around 12 or so asset files with various extensions, signatures, sha, etc.
The thing is, we have dynamic names in our filenames based on dates. Would something like this work?
I'm asking because I'm still setting things up and it's going to be a while. Figured I'd ask before planning all around this.
As an alternative, could we add a way to pass/read in an array? Or, to run a bash command to obtain the filenames?
Because I can easily do something like this:
Where it would list all the files we want to upload.
This would actually be ideal so we can have just 1
upload-release-asset
, instead of 12!!!Thoughts?
The text was updated successfully, but these errors were encountered: