You could define the env variable as follow (remember to put string literal in single quotes):
env:
GODOT_MONO_BUILD_TAG: ${{ github.event.inputs.mono-build-repo || 'latest' }}
where latest should be the default value for the env var
How to use env variable as default value for input in github actions? - Stack Overflow
Passing Environment Variables to Reusable Workflow
Default behavior of environment variables and the setup of ${{ env.* }}
In Github Actions NODE_ENV env variable should be equal "test" or "ci"?
Videos
You could define the env variable as follow (remember to put string literal in single quotes):
env:
GODOT_MONO_BUILD_TAG: ${{ github.event.inputs.mono-build-repo || 'latest' }}
where latest should be the default value for the env var
The suggestion to use the env context is a good one although its use is limited - For example, I found that the env context can not be used for workflow or job names, only for step names:
on:
push:
workflow_dispatch:
inputs:
my-var:
default: abc
env:
TAG: ${{ inputs.my-var || 'abc' }}
run-name: My Workflow with variable [${{ env.MY_VAR }}] << does not work
jobs:
some-job:
name: My JOB with variable [${{ env.MY_VAR }}] << does not work
steps:
- name: My Step with variable [${{ env.MY_VAR }}] << works!
We can use inputs for the workflow/job names but on push events, those values are empty :-(
An alternative is to use store defaults in Repository/Organization variables that can then be accessed from the vars context - i.e. you could do something like ${{ inputs.my-var || vars.DEFAULT_MY_VAR }}
If there are any other suggestions for using (default) variables regardless of the event type - please post them.
It would be awesome if a push event could inherit the default inputs from the workflow_dispatch event ...
More about contexts and how to use them here