Skip to Content
Octopus Energy Packages

oe.env sync

Configure oe.env sync targets, variables, and dry runs

Use oe.env sync to load variables from varlock and sync them to Vercel, GitHub Actions secrets and variables, and/or CircleCI.

Options

OptionDefaultDescription
--vercelpreview, productionSync to Vercel defaults.
--vercel=<env>NoneSync to one Vercel environment. Repeatable.
--vercel=<project>:<env>NoneSync to one Vercel environment for a specific project. Repeatable.
--circle-cipreviewSync to the default CircleCI source environment.
--circle-ci=<env>NoneSync to one CircleCI source environment.
--circle-ci=<project>:<env>NoneSync to one CircleCI project and source environment.
--githubpreviewSync preview values to GitHub. Uses OE_ENV_GITHUB_ENVIRONMENT when set, otherwise repository scope.
--github=<env>NoneSync one source environment to GitHub. Uses OE_ENV_GITHUB_ENVIRONMENT when set, otherwise repository scope.
--github=<github-env>:<env>NoneSync one source environment to an explicit GitHub environment.
--include=<names>All syncable namesComma-separated variable names to sync.
--exclude=<names>NoneComma-separated variable names to omit from the selected sync set.
--dry-runfalseValidate and preview without making changes.

When no target flags are provided, the tool attempts the default targets: vercel:preview, vercel:production, and circle-ci:preview. GitHub is opt in and is not part of the default target set. In this implicit mode, unavailable services are skipped. When a target flag is provided explicitly, that service must pass its checks or the command exits with an error.

Valid source environments are development, preview, and production. Bare service flags select their default environments. You can also pass default explicitly. Both --vercel preview and --vercel=preview are accepted. Empty values, such as --vercel=, are rejected. Use oe.env sync --help to show usage.

GitHub Actions usage

When syncing to GitHub, varlock sensitivity decides the destination: sensitive values are available through the secrets context, and non-sensitive values are available through the vars context. Reference synced values in your workflow files:

KRAKEN_GRAPHQL_ENDPOINT: ${{ vars.KRAKEN_GRAPHQL_ENDPOINT }}
KRAKEN_X_CLIENT_IP_SECRET_KEY: ${{ secrets.KRAKEN_X_CLIENT_IP_SECRET_KEY }}

Target limitations

CircleCI only supports one source environment per sync. Vercel and GitHub support multiple targets when every target resolves to a distinct final destination. Vercel destinations are project and environment pairs. GitHub destinations are repository scope or GitHub environment scope. The command exits with an error when two targets resolve to the same destination.

Usage

On this page