You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have a lot of packages and use a multiline string for the packages parameter the setup fails, because bash attempts top run the second line as a command.
Instead of directly using the GitHub action variable interpolation you should pass the parameters as environment variables in order to prevent breakage (and command injection):
Note that simply adding " " around ${{ inputs.packages }} in the run command will still allow command injection if someone uses a " in the packages parameter. So using env vars is cleaner.
However, this then passes the packages as a single parameter, but since you then do this anyway it shouldn't matter (in fact make that simpler, since you merge it into a single string anyway):
Sorry for the lag here. Thank you for the detailed report. I have a duplicate issue open in #84. Going to dupe this against #84 since I already commited some test code under that.
* Address block style package issue #84#88
* Use cache key for upload artifact name #89.
* Sync master back to dev. (#92)
* Fix if condition for upload-logs step (#87)
Previously the if condition was always evaluating to a truthy string
(e.g. 'false == "true"' or 'true == "true"') as the string comparison
(`== 'true'`) was not inside the expression syntax (`${{ }}`) and thus
being treated as a string rather than being evaluated.
* Introduce a force update value for reloading cache #82
---------
Co-authored-by: Leroy Hopson <[email protected]>
---------
Co-authored-by: Leroy Hopson <[email protected]>
If you have a lot of packages and use a multiline string for the packages parameter the setup fails, because bash attempts top run the second line as a command.
Instead of directly using the GitHub action variable interpolation you should pass the parameters as environment variables in order to prevent breakage (and command injection):
Change here:
cache-apt-pkgs-action/action.yml
Lines 44 to 52 in 9b2b4f2
cache-apt-pkgs-action/action.yml
Lines 61 to 73 in 9b2b4f2
Note that simply adding " " around
${{ inputs.packages }}
in the run command will still allow command injection if someone uses a " in the packages parameter. So using env vars is cleaner.However, this then passes the packages as a single parameter, but since you then do this anyway it shouldn't matter (in fact make that simpler, since you merge it into a single string anyway):
cache-apt-pkgs-action/pre_cache_action.sh
Lines 28 to 31 in 9b2b4f2
cache-apt-pkgs-action/post_cache_action.sh
Lines 29 to 35 in 9b2b4f2
cache-apt-pkgs-action/install_and_cache_pkgs.sh
Lines 19 to 22 in 9b2b4f2
The text was updated successfully, but these errors were encountered: