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

Answer from Matteo on Stack Overflow
🌐
GitHub
docs.github.com › en › actions › reference › workflows-and-actions › variables
Variables reference - GitHub Docs
You can't overwrite the value of the default environment variables named GITHUB_* and RUNNER_*. Currently you can overwrite the value of the CI variable. However, it's not guaranteed that this will always be possible.
🌐
GitHub
docs.github.com › actions › learn-github-actions › variables
Store information in variables - GitHub Docs
GitHub sets default variables for each GitHub Actions workflow run. You can also set custom variables for use in a single workflow or multiple workflows. ... To set a custom environment variable for a single workflow, you can define it using ...
Discussions

How to use env variable as default value for input in github actions? - Stack Overflow
I have a github action that has an input which should have a default value based on an env.variable. Because github actions doesn't support env variables in the default field, I was wondering if I ... More on stackoverflow.com
🌐 stackoverflow.com
Passing Environment Variables to Reusable Workflow
It’s my understanding that the environment from main workflow does not extend to the reusable workflow it calls. When I dump the env from both jobs to the stdout, indeed, the env variables I set in... More on github.com
🌐 github.com
30
94
Default behavior of environment variables and the setup of ${{ env.* }}
Up until now, I always assumed that whatever environment the runner was running in would be populated into the jobs. .env but I’ve just run some tests, and this does not seem to be the case.... More on github.com
🌐 github.com
4
1
April 26, 2020
In Github Actions NODE_ENV env variable should be equal "test" or "ci"?
I feel like the correct answer is, you shouldn't be checking in your local testing .env into source control. More on reddit.com
🌐 r/devops
4
1
June 14, 2022
🌐
Vercel
vercel.com › vercel documentation › build & deploy › environment variables
Environment variables
February 23, 2026 - Environment variables are key-value pairs configured outside your source code so that each value can change depending on the Environment. These values are encrypted at rest and visible to any user that has access to the project.
🌐
GitHub
docs.github.com › actions › using-workflows › workflow-syntax-for-github-actions
Workflow syntax for GitHub Actions - GitHub Docs
Actions does not guarantee the order that matrix jobs will run in. Ensure that the output name is unique, otherwise the last matrix job that runs will override the output value. A map of variables that are available to all steps in the job. You can set variables for the entire workflow or an individual step. For more information, see env and jobs.<job_id>.steps[*].env. When more than one environment variable is defined with the same name, GitHub uses the most specific variable.
🌐
Thomas-niebler
thomas-niebler.de › 2024 › 09 › 05 › env-vars-in-github-actions
Env vars in Github Actions - Thomas Niebler
September 5, 2024 - In fact, it sets the string $INPUT_DEFAULT_ENV as the default value, but does not replace it with the value of the environment variable. However, in the very simple experiment setup that I did, this value is being entered into a bash environment. In detail, the replacement steps work as follows: The Github action sees that it should run the text
🌐
Graphite
graphite.com › guides › github-actions-variables
GitHub Actions variables
GitHub Actions provides a set of default environment variables that are automatically available within your workflow. These variables can provide useful context such as the branch name, commit SHA, repository details, and more.
Find elsewhere
🌐
Configu
configu.com › home › how to use github actions environment variables
How to Use Github Actions Environment Variables - Configu
January 17, 2025 - Let’s explore these different types to better understand their roles and how they can be applied in your workflows. Default environment variables are automatically set by GitHub Actions.
🌐
Earthly
earthly.dev › blog › github-actions-environment-variables-and-secrets
Working with GitHub Actions Environment Variables and Secrets - Earthly Blog
July 11, 2023 - Here’s a shorter list of 10 important GitHub Actions environment variables: GITHUB_WORKSPACE - The default working directory for steps and location of your repo.
🌐
Snyk
snyk.io › blog › how-to-use-github-actions-environment-variables
How to use GitHub Actions environment variables | Snyk
November 22, 2022 - To access this variable, we must use a specific syntax similar to that used when accessing UNIX environment variables. To use our NAME variable, we must prefix it with a dollar sign, changing the variable to $NAME. Let’s add a new step to our workflow on line 23 that prints this variable out: ... Commit and push this change to the repository. Then, open GitHub in a browser and navigate to the Actions tab within the repository.
🌐
GitHub
docs.github.com › en › actions › reference › workflows-and-actions › contexts
Contexts reference - GitHub Docs
GitHub Actions includes a collection ... different points in the workflow: Default environment variables: These environment variables exist only on the runner that ......
🌐
GitHub
docs.github.com › en › actions › reference › workflows-and-actions › workflow-commands
Workflow commands for GitHub Actions - GitHub Docs
The step that creates or updates the environment variable does not have access to the new value, but all subsequent steps in a job will have access. You can't overwrite the value of the default environment variables named GITHUB_* and RUNNER_*. ...
🌐
Medium
medium.com › @woeterman_94 › how-to-use-environment-specific-variables-in-github-actions-workflows-8b7252956d8e
How to Use Environment-specific Variables in GitHub Actions Workflows | by Wouter | Medium
December 8, 2025 - This tutorial shows how to configure your GitHub Actions workflows so that variables like CLIENT_IDare automatically set based on the environment you deploy to.
🌐
AWS
aws.amazon.com › blogs › containers › automated-deployments-with-github-actions-for-amazon-ecs-express-mode
Automated deployments with GitHub Actions for Amazon ECS Express Mode | Amazon Web Services
1 month ago - Go to Settings, choose Secrets and variables, choose Actions, choose Variables tab. Add each of the following variables by selecting New repository variable: Note: To specify an existing Amazon ECS cluster name other than default, you must create ...
🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › environment-variables-full-list-github-actions
Full GitHub Actions environment variables list for YAML build workflow scripts example
The standard documentation pages tell developers about the default GitHub Actions environment variables, which are prefixed with the string GITHUB and includes variables such as GITHUB_WORKFLOW, GITHUB_RUN_ID and GITHUB_ACTION.
🌐
GitHub
docs.github.com › actions › deployment › targeting-different-environments › using-environments-for-deployment
Managing environments for deployment - GitHub Docs
As the workflow progresses, it also creates deployment status objects with the environment property set to the name of your environment, the environment_url property set to the URL for environment (if specified in the workflow), and the state property set to the status of the job. You can access these objects through the REST API or GraphQL API. You can also subscribe to these webhook events. For more information, see REST API endpoints for repositories, Objects (GraphQL API), or Webhook events and payloads. GitHub Actions provides several features for managing your deployments.
Top answer
1 of 1
47
//.github/workflows/@ with: build-and-verify: ${{needs.EnvSetup.outputs.build-and-verify}} secrets: token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"">
name: Project Specific Workflow
on:
  push:
    branches: []
  pull_request:
    branches: []
  workflow_dispatch:
    # Defaults here are for worflow_dispatch only, all other events are set in EnvSetup.setup-output-defaults:
    inputs:
      build-and-verify:
        description: 'Do a build and verify'
        required: true
        default: 'true'    
jobs:
  EnvSetup:
    name: Setup Dynamic Environment Variables
    runs-on: 
    outputs:
      build-and-verify: ${{ steps.set-output-defaults.outputs.build-and-verify }}
    steps:
      - name: set outputs with default values
        id: set-output-defaults
        run: |    
          # If workflow_dispatch, use inputs (left), if other trigger, use default env (right)
          echo "::set-output name=build-and-verify::${{ github.event.inputs.build-and-verify || 'true' }}"
  invoke-workflow:
    needs: [EnvSetup]
    uses: //.github/workflows/@
    with:
      build-and-verify: ${{needs.EnvSetup.outputs.build-and-verify}}
    secrets:
      token: "${{ secrets.PERSONAL_ACCESS_TOKEN }}"

Some important things to note about this code snippet that calls a reusable workflow:

  1. The “uses” statement that calls the reusable workflow can’t evaluate expressions yet. That means the repo name, branch, etc. must be hardcoded.
  2. The “with” statement that supplies arguments can only take elements from the github context and the “needs” object, so you MUST have a line that “needs” the job where you set the values and return the outputs.
  3. the echo "::set-output name=::${{}} syntax is where the variable is set and exposed as a step output, then it is returned with the job output that references it. Pay attention to the names of each object to see how they fit together.
  4. Because you can’t pass ENV variables to the reusable workflow, they are almost useless in this pattern.
  5. I’m hoping GitHub comes up with a better way to assign values inline or pass them into reusable workflows, because handling each parameter three or more times just to pass it into a reusable workflow is cumbersome.
  6. I included some extra trimmings to show how to pass secrets to the reusable workflow and evaluate the default vs. an input inline during variable assignment. The problem is that your default from the “inputs” section of “workflow_dispatch” only gets assigned on workflow_dispatch, and not on any other trigger. So the ${{ $var || value }} syntax lets you assign the value on the right if the one on the left is empty.
🌐
Plzm
plzm.blog › 202203-env-vars
Don't Repeat Yourself: Environment Variables in GitHub Actions and locally
March 11, 2022 - How to do this? I need to detect whether I'm in a GitHub Actions workflow, and only if so, write to GITHUB_ENV so that later workflow steps can use the environment variables I set. GitHub Actions sets several default environment variables in the runner environments.
🌐
OnboardBase
onboardbase.com › blog › github-actions-environment-variables
Github Actions Environment Variables: Guide, Examples & Tips
For example, given the following workflow configuration that prints the value of the environment variable ENV_VARIABLE on each git push of the corresponding code repository: ... name: Github Actions test on: [push] env: ENV_VARIABLE: ok jobs: test: runs-on: ubuntu-latest steps: - run: echo "$ENV_VARIABLE"