Skip to content

How to pass environment variable to an input? #26529

Answered by chrispat
crazy-max asked this question in Actions
Discussion options

You must be logged in to vote

You currently can’t reference environment variables as inputs.  Unless you really want that particular value to be an environment variable I would suggest you set it as an output of the step and then you can reference that output in the input of subsiquent step.  

https://help.github.com/en/articles/development-tools-for-github-actions#set-an-output-parameter-set-output

- run: echo ::set-output name=action_fruit::strawberry
   id: fruit
- uses: actions/hello-world-javascript-action@master
   with:
     who-to-greet: ${{ steps.fruit.outputs.action_fruit }}

Replies: 9 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@Pyrrha
Comment options

Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@filipkrw
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
10 participants