Skip to content
Discussion options

You must be logged in to vote

@dogboydog,

Yes, currently GitHub does not automatically create environment variables for the inputs of the ‘workflow_dispatch’ trigger.

If you want to use the inputs as environment variables in the workflow, you can set the inputs as the workflow global environment variables via the ‘env’ key.
For example:

on:
  workflow_dispatch:
    inputs:
      log_Level:
        description: 'Log level'
        required: true
        default: 'warning'

env:
INPUT_LOG_LEVEL: ${{ github.event.inputs.log_Level }}

jobs:
job1:
runs-on: ubuntu-latest
steps:
- name: Print input
run: echo "The log level is $INPUT_LOG_LEVEL"

However, as mentioned in the docs, you also need to note that:

When more than one …

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@Yarden-zamir
Comment options

@dogboydog
Comment options

@SvenStaehs
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product Feedback Share your thoughts and suggestions on GitHub features and improvements
4 participants