-
I see people using workflow_dispatch github.event.inputs as I am here: ltabus/up.yml at 8e896bb75330757e440fe7f429aaa9ead7cfd90e · kaihendry/ltabus · GitHub But how do you set a default if the job is run on a push?! |
Beta Was this translation helpful? Give feedback.
Replies: 7 comments 5 replies
-
Unfortunately, this is not possible. There is no way for you to define inputs on a push event. The Events that trigger workflows - GitHub Docs//docs.github.com/en/actions/reference/events-that-trigger-workflows Events that trigger workflows - GitHub Docs//docs.github.com/en/actions/reference/events-that-trigger-workflows |
Beta Was this translation helpful? Give feedback.
-
I keep on getting bitten by this issue. I want to deploy to staging by default. And then github.comBuild software better, togetherGitHub is where people build software. More than 56 million people use GitHub to discover, fork, and contribute to over 100 million projects. And then run production once I’ve manually tested staging: I’m really tired of: Is there no sane workaround? |
Beta Was this translation helpful? Give feedback.
-
@kaihendry Have an approval on production environment. Then staging deploys and waits for production to be approved |
Beta Was this translation helpful? Give feedback.
-
While not DRY, this is a possible workaround:
Or like this, using a pseudo-ternary operator:
|
Beta Was this translation helpful? Give feedback.
-
I just ran across this issue myself. I want to define inputs as per workflow_dispatch with default values that are defined when using other event triggers. |
Beta Was this translation helpful? Give feedback.
-
I guess you are not alone. I need this too, in case i have branch push and i would like the values to be there. From official documentation: You can see above a default and i should be to use that as default value, no matter what! |
Beta Was this translation helpful? Give feedback.
-
Came across this via Google and just wanted to chime in that Ex: on:
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
type: choice
options:
- info
- warning
- debug |
Beta Was this translation helpful? Give feedback.
Unfortunately, this is not possible. There is no way for you to define inputs on a push event. The
github.event.inputs
context will contain key value pairs only if the workflow was triggered by aworkflow_dispatch
event.docs.github.com
Events that trigger workflows - GitHub Docs
//docs.github.com/en/actions/reference/events-that-trigger-workflows
docs.github.com
Events that trigger workflows - GitHub Docs
//docs.github.com/en/actions/reference/events-that-trigger-workflows