| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
Would step environment variables work here and avoid the quotes issue? https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstepsenv A couple concerns with this approach:
If environment variables support your case, I'd prefer we document how to use those as inputs. For example: - uses: actions/github-script@v3
env:
FIRST_NAME: Mona
LAST_NAME: Octocat
with:
script: console.log(`Hello ${process.env.FIRST_NAME} ${process.env.LAST_NAME}`) |
Sorry, something went wrong.
|
@joshmgross Thanks - not sure why I didn't think of that. It works perfectly. I updated my PR to simply update the README. |
Sorry, something went wrong.
There was a problem hiding this comment.
Awesome, thanks for this!
Sorry, something went wrong.
|
I updated the npm command example to remove the -g flag. Thanks for the quick review! :) |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
ℹ️ Updated to document env and process.env as inputs.
We've been using actions/github-script to glue together different build tools. We've had cases where we want to passthrough outputs of other scripts to this action –
One way would be to just use an input value:
which works, but displays this warning:
Another way would be to inline the value:
but this can cause issues depending on what the value of the string is, and requires you to be aware of how your string will interact with the program:
So this PR introduces a simple input variable that is exposed directly to the function:
It can be combined with JSON.parse(input) in the script to pass through stringified JSON (from other jobs or CLI tools, for example).
I also made two other changes