ActionsEnvironmentVariable

class ActionsEnvironmentVariable : KotlinCustomResource

This resource allows you to create and manage GitHub Actions variables within your GitHub repository environments. You must have write access to a repository to use this resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const exampleVariable = new github.ActionsEnvironmentVariable("example_variable", {
environment: "example_environment",
variableName: "example_variable_name",
value: "example_variable_value",
});
import pulumi
import pulumi_github as github
example_variable = github.ActionsEnvironmentVariable("example_variable",
environment="example_environment",
variable_name="example_variable_name",
value="example_variable_value")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var exampleVariable = new Github.ActionsEnvironmentVariable("example_variable", new()
{
Environment = "example_environment",
VariableName = "example_variable_name",
Value = "example_variable_value",
});
});
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := github.NewActionsEnvironmentVariable(ctx, "example_variable", &github.ActionsEnvironmentVariableArgs{
Environment: pulumi.String("example_environment"),
VariableName: pulumi.String("example_variable_name"),
Value: pulumi.String("example_variable_value"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.ActionsEnvironmentVariable;
import com.pulumi.github.ActionsEnvironmentVariableArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var exampleVariable = new ActionsEnvironmentVariable("exampleVariable", ActionsEnvironmentVariableArgs.builder()
.environment("example_environment")
.variableName("example_variable_name")
.value("example_variable_value")
.build());
}
}
resources:
exampleVariable:
type: github:ActionsEnvironmentVariable
name: example_variable
properties:
environment: example_environment
variableName: example_variable_name
value: example_variable_value
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const repo = github.getRepository({
fullName: "my-org/repo",
});
const repoEnvironment = new github.RepositoryEnvironment("repo_environment", {
repository: repo.then(repo => repo.name),
environment: "example_environment",
});
const exampleVariable = new github.ActionsEnvironmentVariable("example_variable", {
repository: repo.then(repo => repo.name),
environment: repoEnvironment.environment,
variableName: "example_variable_name",
value: "example_variable_value",
});
import pulumi
import pulumi_github as github
repo = github.get_repository(full_name="my-org/repo")
repo_environment = github.RepositoryEnvironment("repo_environment",
repository=repo.name,
environment="example_environment")
example_variable = github.ActionsEnvironmentVariable("example_variable",
repository=repo.name,
environment=repo_environment.environment,
variable_name="example_variable_name",
value="example_variable_value")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var repo = Github.GetRepository.Invoke(new()
{
FullName = "my-org/repo",
});
var repoEnvironment = new Github.RepositoryEnvironment("repo_environment", new()
{
Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name),
Environment = "example_environment",
});
var exampleVariable = new Github.ActionsEnvironmentVariable("example_variable", new()
{
Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name),
Environment = repoEnvironment.Environment,
VariableName = "example_variable_name",
Value = "example_variable_value",
});
});
package main
import (
"github.com/pulumi/pulumi-github/sdk/v6/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
repo, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{
FullName: pulumi.StringRef("my-org/repo"),
}, nil)
if err != nil {
return err
}
repoEnvironment, err := github.NewRepositoryEnvironment(ctx, "repo_environment", &github.RepositoryEnvironmentArgs{
Repository: pulumi.String(repo.Name),
Environment: pulumi.String("example_environment"),
})
if err != nil {
return err
}
_, err = github.NewActionsEnvironmentVariable(ctx, "example_variable", &github.ActionsEnvironmentVariableArgs{
Repository: pulumi.String(repo.Name),
Environment: repoEnvironment.Environment,
VariableName: pulumi.String("example_variable_name"),
Value: pulumi.String("example_variable_value"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.GithubFunctions;
import com.pulumi.github.inputs.GetRepositoryArgs;
import com.pulumi.github.RepositoryEnvironment;
import com.pulumi.github.RepositoryEnvironmentArgs;
import com.pulumi.github.ActionsEnvironmentVariable;
import com.pulumi.github.ActionsEnvironmentVariableArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var repo = GithubFunctions.getRepository(GetRepositoryArgs.builder()
.fullName("my-org/repo")
.build());
var repoEnvironment = new RepositoryEnvironment("repoEnvironment", RepositoryEnvironmentArgs.builder()
.repository(repo.applyValue(getRepositoryResult -> getRepositoryResult.name()))
.environment("example_environment")
.build());
var exampleVariable = new ActionsEnvironmentVariable("exampleVariable", ActionsEnvironmentVariableArgs.builder()
.repository(repo.applyValue(getRepositoryResult -> getRepositoryResult.name()))
.environment(repoEnvironment.environment())
.variableName("example_variable_name")
.value("example_variable_value")
.build());
}
}
resources:
repoEnvironment:
type: github:RepositoryEnvironment
name: repo_environment
properties:
repository: ${repo.name}
environment: example_environment
exampleVariable:
type: github:ActionsEnvironmentVariable
name: example_variable
properties:
repository: ${repo.name}
environment: ${repoEnvironment.environment}
variableName: example_variable_name
value: example_variable_value
variables:
repo:
fn::invoke:
function: github:getRepository
arguments:
fullName: my-org/repo

Import

This resource can be imported using an ID made up of the repository name, environment name, and variable name:

$ pulumi import github:index/actionsEnvironmentVariable:ActionsEnvironmentVariable test_variable myrepo:myenv:myvariable

Properties

Link copied to clipboard
val createdAt: Output<String>

Date of actions_environment_secret creation.

Link copied to clipboard
val environment: Output<String>

Name of the environment.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val repository: Output<String>

Name of the repository.

Link copied to clipboard
val updatedAt: Output<String>

Date of actions_environment_secret update.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val value: Output<String>

Value of the variable

Link copied to clipboard
val variableName: Output<String>

Name of the variable.