Skip to main content
Module

x/actionify/mod.ts>commands.exportVariable

Create and manage your GitHub workflows with TypeScript and Deno.
Go to Latest
function commands.exportVariable
import { commands } from "https://deno.land/x/actionify@0.2.0/mod.ts";
const { exportVariable } = commands;

You can make an environment variable available to any subsequent steps in a workflow job by defining or updating the environment variable and writing this to the GITHUB_ENV environment file. 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. The names of environment variables are case-sensitive, and you can include punctuation.

Once an environment variable is added in this way it can be removed by setting it to the empty string.

import { commands, step } from "https://deno.land/x/actionify@0.2.0/mod.ts";

const addStep = step()
  .run(commands.exportVariable(
    "AWESOME_ENV",
    "this is the env",
  ));

// Set the variable to an empty string.
const removeStep = step()
  .run(commands.exportVariable("AWESOME_ENV", ""));

If isDynamic is set to true the provided value is not wrapped in quotes and will be run as an expression.

Type Parameters

Env extends string

Parameters

name: Env
value: ExpressionValue
optional
isDynamic = [UNSUPPORTED]

Returns

Command<{ env: Env; output: never; }>