Skip to content

How to pass environment variable to an input? #26529

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: 7 suggested answers

Comment options

You must be logged in to vote
0 replies
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
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
6 participants