published on Thursday, Feb 12, 2026 by Pulumi
published on Thursday, Feb 12, 2026 by Pulumi
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 example = new github.ActionsEnvironmentVariable("example", {
repository: "example-repo",
environment: "example-environment",
variableName: "example_variable_name",
value: "example-value",
});
import pulumi
import pulumi_github as github
example = github.ActionsEnvironmentVariable("example",
repository="example-repo",
environment="example-environment",
variable_name="example_variable_name",
value="example-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", &github.ActionsEnvironmentVariableArgs{
Repository: pulumi.String("example-repo"),
Environment: pulumi.String("example-environment"),
VariableName: pulumi.String("example_variable_name"),
Value: pulumi.String("example-value"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var example = new Github.ActionsEnvironmentVariable("example", new()
{
Repository = "example-repo",
Environment = "example-environment",
VariableName = "example_variable_name",
Value = "example-value",
});
});
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 example = new ActionsEnvironmentVariable("example", ActionsEnvironmentVariableArgs.builder()
.repository("example-repo")
.environment("example-environment")
.variableName("example_variable_name")
.value("example-value")
.build());
}
}
resources:
example:
type: github:ActionsEnvironmentVariable
properties:
repository: example-repo
environment: example-environment
variableName: example_variable_name
value: example-value
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const example = github.getRepository({
fullName: "my-org/repo",
});
const exampleRepositoryEnvironment = new github.RepositoryEnvironment("example", {
repository: example.then(example => example.name),
environment: "example_environment",
});
const exampleActionsEnvironmentVariable = new github.ActionsEnvironmentVariable("example", {
repository: example.then(example => example.name),
environment: exampleRepositoryEnvironment.environment,
variableName: "example_variable_name",
value: "example-value",
});
import pulumi
import pulumi_github as github
example = github.get_repository(full_name="my-org/repo")
example_repository_environment = github.RepositoryEnvironment("example",
repository=example.name,
environment="example_environment")
example_actions_environment_variable = github.ActionsEnvironmentVariable("example",
repository=example.name,
environment=example_repository_environment.environment,
variable_name="example_variable_name",
value="example-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 {
example, err := github.LookupRepository(ctx, &github.LookupRepositoryArgs{
FullName: pulumi.StringRef("my-org/repo"),
}, nil)
if err != nil {
return err
}
exampleRepositoryEnvironment, err := github.NewRepositoryEnvironment(ctx, "example", &github.RepositoryEnvironmentArgs{
Repository: pulumi.String(example.Name),
Environment: pulumi.String("example_environment"),
})
if err != nil {
return err
}
_, err = github.NewActionsEnvironmentVariable(ctx, "example", &github.ActionsEnvironmentVariableArgs{
Repository: pulumi.String(example.Name),
Environment: exampleRepositoryEnvironment.Environment,
VariableName: pulumi.String("example_variable_name"),
Value: pulumi.String("example-value"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var example = Github.GetRepository.Invoke(new()
{
FullName = "my-org/repo",
});
var exampleRepositoryEnvironment = new Github.RepositoryEnvironment("example", new()
{
Repository = example.Apply(getRepositoryResult => getRepositoryResult.Name),
Environment = "example_environment",
});
var exampleActionsEnvironmentVariable = new Github.ActionsEnvironmentVariable("example", new()
{
Repository = example.Apply(getRepositoryResult => getRepositoryResult.Name),
Environment = exampleRepositoryEnvironment.Environment,
VariableName = "example_variable_name",
Value = "example-value",
});
});
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 example = GithubFunctions.getRepository(GetRepositoryArgs.builder()
.fullName("my-org/repo")
.build());
var exampleRepositoryEnvironment = new RepositoryEnvironment("exampleRepositoryEnvironment", RepositoryEnvironmentArgs.builder()
.repository(example.name())
.environment("example_environment")
.build());
var exampleActionsEnvironmentVariable = new ActionsEnvironmentVariable("exampleActionsEnvironmentVariable", ActionsEnvironmentVariableArgs.builder()
.repository(example.name())
.environment(exampleRepositoryEnvironment.environment())
.variableName("example_variable_name")
.value("example-value")
.build());
}
}
resources:
exampleRepositoryEnvironment:
type: github:RepositoryEnvironment
name: example
properties:
repository: ${example.name}
environment: example_environment
exampleActionsEnvironmentVariable:
type: github:ActionsEnvironmentVariable
name: example
properties:
repository: ${example.name}
environment: ${exampleRepositoryEnvironment.environment}
variableName: example_variable_name
value: example-value
variables:
example:
fn::invoke:
function: github:getRepository
arguments:
fullName: my-org/repo
Create ActionsEnvironmentVariable Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ActionsEnvironmentVariable(name: string, args: ActionsEnvironmentVariableArgs, opts?: CustomResourceOptions);@overload
def ActionsEnvironmentVariable(resource_name: str,
args: ActionsEnvironmentVariableArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ActionsEnvironmentVariable(resource_name: str,
opts: Optional[ResourceOptions] = None,
environment: Optional[str] = None,
repository: Optional[str] = None,
value: Optional[str] = None,
variable_name: Optional[str] = None)func NewActionsEnvironmentVariable(ctx *Context, name string, args ActionsEnvironmentVariableArgs, opts ...ResourceOption) (*ActionsEnvironmentVariable, error)public ActionsEnvironmentVariable(string name, ActionsEnvironmentVariableArgs args, CustomResourceOptions? opts = null)
public ActionsEnvironmentVariable(String name, ActionsEnvironmentVariableArgs args)
public ActionsEnvironmentVariable(String name, ActionsEnvironmentVariableArgs args, CustomResourceOptions options)
type: github:ActionsEnvironmentVariable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args ActionsEnvironmentVariableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ActionsEnvironmentVariableArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ActionsEnvironmentVariableArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ActionsEnvironmentVariableArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ActionsEnvironmentVariableArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var actionsEnvironmentVariableResource = new Github.ActionsEnvironmentVariable("actionsEnvironmentVariableResource", new()
{
Environment = "string",
Repository = "string",
Value = "string",
VariableName = "string",
});
example, err := github.NewActionsEnvironmentVariable(ctx, "actionsEnvironmentVariableResource", &github.ActionsEnvironmentVariableArgs{
Environment: pulumi.String("string"),
Repository: pulumi.String("string"),
Value: pulumi.String("string"),
VariableName: pulumi.String("string"),
})
var actionsEnvironmentVariableResource = new ActionsEnvironmentVariable("actionsEnvironmentVariableResource", ActionsEnvironmentVariableArgs.builder()
.environment("string")
.repository("string")
.value("string")
.variableName("string")
.build());
actions_environment_variable_resource = github.ActionsEnvironmentVariable("actionsEnvironmentVariableResource",
environment="string",
repository="string",
value="string",
variable_name="string")
const actionsEnvironmentVariableResource = new github.ActionsEnvironmentVariable("actionsEnvironmentVariableResource", {
environment: "string",
repository: "string",
value: "string",
variableName: "string",
});
type: github:ActionsEnvironmentVariable
properties:
environment: string
repository: string
value: string
variableName: string
ActionsEnvironmentVariable Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ActionsEnvironmentVariable resource accepts the following input properties:
- Environment string
- Name of the environment.
- Repository string
- Name of the repository.
- Value string
- Value of the variable.
- Variable
Name string - Name of the variable.
- Environment string
- Name of the environment.
- Repository string
- Name of the repository.
- Value string
- Value of the variable.
- Variable
Name string - Name of the variable.
- environment String
- Name of the environment.
- repository String
- Name of the repository.
- value String
- Value of the variable.
- variable
Name String - Name of the variable.
- environment string
- Name of the environment.
- repository string
- Name of the repository.
- value string
- Value of the variable.
- variable
Name string - Name of the variable.
- environment str
- Name of the environment.
- repository str
- Name of the repository.
- value str
- Value of the variable.
- variable_
name str - Name of the variable.
- environment String
- Name of the environment.
- repository String
- Name of the repository.
- value String
- Value of the variable.
- variable
Name String - Name of the variable.
Outputs
All input properties are implicitly available as output properties. Additionally, the ActionsEnvironmentVariable resource produces the following output properties:
- Created
At string - Date the variable was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Repository
Id int - ID of the repository.
- Updated
At string - Date the variable was last updated.
- Created
At string - Date the variable was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Repository
Id int - ID of the repository.
- Updated
At string - Date the variable was last updated.
- created
At String - Date the variable was created.
- id String
- The provider-assigned unique ID for this managed resource.
- repository
Id Integer - ID of the repository.
- updated
At String - Date the variable was last updated.
- created
At string - Date the variable was created.
- id string
- The provider-assigned unique ID for this managed resource.
- repository
Id number - ID of the repository.
- updated
At string - Date the variable was last updated.
- created_
at str - Date the variable was created.
- id str
- The provider-assigned unique ID for this managed resource.
- repository_
id int - ID of the repository.
- updated_
at str - Date the variable was last updated.
- created
At String - Date the variable was created.
- id String
- The provider-assigned unique ID for this managed resource.
- repository
Id Number - ID of the repository.
- updated
At String - Date the variable was last updated.
Look up Existing ActionsEnvironmentVariable Resource
Get an existing ActionsEnvironmentVariable resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ActionsEnvironmentVariableState, opts?: CustomResourceOptions): ActionsEnvironmentVariable@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
environment: Optional[str] = None,
repository: Optional[str] = None,
repository_id: Optional[int] = None,
updated_at: Optional[str] = None,
value: Optional[str] = None,
variable_name: Optional[str] = None) -> ActionsEnvironmentVariablefunc GetActionsEnvironmentVariable(ctx *Context, name string, id IDInput, state *ActionsEnvironmentVariableState, opts ...ResourceOption) (*ActionsEnvironmentVariable, error)public static ActionsEnvironmentVariable Get(string name, Input<string> id, ActionsEnvironmentVariableState? state, CustomResourceOptions? opts = null)public static ActionsEnvironmentVariable get(String name, Output<String> id, ActionsEnvironmentVariableState state, CustomResourceOptions options)resources: _: type: github:ActionsEnvironmentVariable get: id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Created
At string - Date the variable was created.
- Environment string
- Name of the environment.
- Repository string
- Name of the repository.
- Repository
Id int - ID of the repository.
- Updated
At string - Date the variable was last updated.
- Value string
- Value of the variable.
- Variable
Name string - Name of the variable.
- Created
At string - Date the variable was created.
- Environment string
- Name of the environment.
- Repository string
- Name of the repository.
- Repository
Id int - ID of the repository.
- Updated
At string - Date the variable was last updated.
- Value string
- Value of the variable.
- Variable
Name string - Name of the variable.
- created
At String - Date the variable was created.
- environment String
- Name of the environment.
- repository String
- Name of the repository.
- repository
Id Integer - ID of the repository.
- updated
At String - Date the variable was last updated.
- value String
- Value of the variable.
- variable
Name String - Name of the variable.
- created
At string - Date the variable was created.
- environment string
- Name of the environment.
- repository string
- Name of the repository.
- repository
Id number - ID of the repository.
- updated
At string - Date the variable was last updated.
- value string
- Value of the variable.
- variable
Name string - Name of the variable.
- created_
at str - Date the variable was created.
- environment str
- Name of the environment.
- repository str
- Name of the repository.
- repository_
id int - ID of the repository.
- updated_
at str - Date the variable was last updated.
- value str
- Value of the variable.
- variable_
name str - Name of the variable.
- created
At String - Date the variable was created.
- environment String
- Name of the environment.
- repository String
- Name of the repository.
- repository
Id Number - ID of the repository.
- updated
At String - Date the variable was last updated.
- value String
- Value of the variable.
- variable
Name String - Name of the variable.
Import
Import Command
The following command imports a GitHub actions environment variable named myvariable for the repo myrepo and environment myenv to a github_actions_environment_variable resource named example.
$ pulumi import github:index/actionsEnvironmentVariable:ActionsEnvironmentVariable example myrepo:myenv:myvariable
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
githubTerraform Provider.
published on Thursday, Feb 12, 2026 by Pulumi
