Skip to content

Set env values conditionally #25625

Answered by pkumarch
pkumarch asked this question in Actions
Discussion options

You must be logged in to vote

Resolved it with following approach:

env:
      ENVIRONMENT_NAME: ${{ secrets[format('{0}_ENVIRONMENT_NAME', github.event.inputs.env_name)] }}
      KUBE_CONFIG: ${{ secrets[format('{0}_KUBE_CONFIG', github.event.inputs.env_name)] }}
      KUBE_CONTEXT: ${{ secrets[format('{0}_KUBE_CONTEXT', github.event.inputs.env_name)] }}

Thanks to examples in Go crazy with GitHub Actions - Sander Knape

Replies: 2 comments

Comment options

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