While DMNO provides everything you need to manage your env vars in your repo, you may want to reuse your env vars across your GitHub Actions workflows. We created a GitHub Action that makes this easier.
Getting Started Workflow
Configuration
Inputs
All inputs are optional!
Name | Description |
---|---|
service-name | Explicitly select the service to populate config for useful in a monorepo with multiple services |
emit-env-vars | Whether to emit environment variables defaults to true |
output-vars | Whether to also provide the config as a job output defaults to false |
skip-regex | Use a regex to skip certain config items from being included |
skip-cache | Whether to skip the cache defaults to false |
clear-cache | Whether to clear the cache defaults to false |
Outputs
If emit-env-vars
is true
, each of your config variables will be emitted as
an environment variable.
If output-vars
is true
, DMNO_CONFIG
is output as a JSON string of
key-value pairs of the generated variables after being processed by the
skip-regex
regular expression.
Additional Workflow Examples
We’ll use the following DMNO service as an example for all of the following workflows:
Using the config in a multi-step jobs
This is a common example where you can re-use the environment variables in a subsequent step in the same job. By default, each item in your schema will be emitted as an environment variable.
You can use the config in a multi-step job like this:
Using the config in a multi-job workflow
Multi-job workflows are slightly more complex since each job will have its own set of environment variables. This means you will need to explicity set the outputs you need to use in any other jobs via the needs
block.
Using with a DMNO plugin (1Password)
If you’re using a plugin that requires a sensitive input, you can set the input as a secret in GitHub and then pass it to the action as an environment variable with the env
block. In most cases, this means you will only need to set a single secret via GitHub and let DMNO handle loading the rest.
In this example, we’re using the 1Password plugin but the workflow is similar for any plugin that requires a sensitive input.
Troubleshooting
Make sure:
- DMNO is installed and set up in your repo
- You have a
.dmno/config.mts
with a valid schema - Your action checks out the repo (e.g.,
actions/checkout@v4
) - Your action installs dependencies (e.g.,
npm install
) - You have set any required sensitive plugin inputs (e.g., Your 1Password service account token) as secrets for your repo or as environment variables in your repo. (See example above.)