How to pass parameters to the script?
See original GitHub issueI am trying to pass variable from previous action to github-script, but can’t figure out syntax. Is it possible at all?
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How can I pass a command line argument into a shell script?
You can access passed arguments with $n where n is the argument number - 1, ...
Read more >How to pass and use arguments in shell script - Educative.io
Inside the script, we can use the $ symbol followed by the integer to access the arguments passed. For example, $1 , $2...
Read more >How to Use Command Line Arguments in a Bash Script
We've previously examined how to pass command-line arguments to a bash script. In this tutorial, we'll take a look at how we can...
Read more >How To Pass and Parse Linux Bash Script Arguments and ...
You can pass parameters or arguments to the file. Just the command for running the script normally by adding the value of the...
Read more >Adding arguments and options to your Bash scripts - Red Hat
The ability to use positional parameters—otherwise known as arguments—to specify data to be used as values for variables in the scripts is one ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@mdvorak The security depends partially on the provenance of the data. If the step output is created in a way the workflow implementer can trust, the solution I posted earlier is generally safe. If the output comes from untrusted data, then it’s not.
As far as I can tell, @acidos was not specifically asking how to safely and securely include literally any type of step output, trusted or untrusted.
In the future, we could potentially attach step outputs to the toolkit context, but it’s currently not possible. Such a feature would provide the prior steps’ output in a JavaScript string that could be used at runtime, rather than interpolated via context expression syntax.
Another, somewhat safer way of doing this would be to set the prior steps’ output as an environment variable in subsequent steps, although this is not specific to this action, it’s just something that can be done with the tools that Actions provides:
See the context and expression syntax documentation for more examples.
The easiest way to do this is via Actions’ expression evaluation syntax (
${{ }}). Assuming you want to use the output from a previous step in your github-script action, you could do something like this:Note that the expression evaluation happens before the action runs, so the raw value will be inserted into the script string (hence the need for quotes).
This assumes that you have a previous step whose ID is “step-id” and that whose outputs include a value called “output-name”. See “About contexts and expressions” and “steps context”.
If this doesn’t answer your question, please reply with an example so I can get a clearer idea of what you mean 😄 Thank you!