published on Monday, Mar 9, 2026 by Pulumi
published on Monday, Mar 9, 2026 by Pulumi
Import
This resource can be imported using an ID made up of the secret name
$ pulumi import github:index/actionsEnvironmentSecret:ActionsEnvironmentSecret test_secret test_secret_name
NOTEthe implementation is limited in that it won’t fetch the value of the plaintext_value field when importing. You may need to ignore changes for the plaintext_value as a workaround.
Example Usage
using System.Collections.Generic;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var exampleSecretActionsEnvironmentSecret = new Github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", new()
{
Environment = "example_environment",
SecretName = "example_secret_name",
PlaintextValue = @var.Some_secret_string,
});
var exampleSecretIndex_actionsEnvironmentSecretActionsEnvironmentSecret = new Github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", new()
{
Environment = "example_environment",
SecretName = "example_secret_name",
EncryptedValue = @var.Some_encrypted_secret_string,
});
});
package main
import (
"github.com/pulumi/pulumi-github/sdk/v4/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := github.NewActionsEnvironmentSecret(ctx, "exampleSecretActionsEnvironmentSecret", &github.ActionsEnvironmentSecretArgs{
Environment: pulumi.String("example_environment"),
SecretName: pulumi.String("example_secret_name"),
PlaintextValue: pulumi.Any(_var.Some_secret_string),
})
if err != nil {
return err
}
_, err = github.NewActionsEnvironmentSecret(ctx, "exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", &github.ActionsEnvironmentSecretArgs{
Environment: pulumi.String("example_environment"),
SecretName: pulumi.String("example_secret_name"),
EncryptedValue: pulumi.Any(_var.Some_encrypted_secret_string),
})
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.ActionsEnvironmentSecret;
import com.pulumi.github.ActionsEnvironmentSecretArgs;
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 exampleSecretActionsEnvironmentSecret = new ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", ActionsEnvironmentSecretArgs.builder()
.environment("example_environment")
.secretName("example_secret_name")
.plaintextValue(var_.some_secret_string())
.build());
var exampleSecretIndex_actionsEnvironmentSecretActionsEnvironmentSecret = new ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", ActionsEnvironmentSecretArgs.builder()
.environment("example_environment")
.secretName("example_secret_name")
.encryptedValue(var_.some_encrypted_secret_string())
.build());
}
}
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const exampleSecretActionsEnvironmentSecret = new github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret", {
environment: "example_environment",
secretName: "example_secret_name",
plaintextValue: _var.some_secret_string,
});
const exampleSecretIndex_actionsEnvironmentSecretActionsEnvironmentSecret = new github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret", {
environment: "example_environment",
secretName: "example_secret_name",
encryptedValue: _var.some_encrypted_secret_string,
});
import pulumi
import pulumi_github as github
example_secret_actions_environment_secret = github.ActionsEnvironmentSecret("exampleSecretActionsEnvironmentSecret",
environment="example_environment",
secret_name="example_secret_name",
plaintext_value=var["some_secret_string"])
example_secret_index_actions_environment_secret_actions_environment_secret = github.ActionsEnvironmentSecret("exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret",
environment="example_environment",
secret_name="example_secret_name",
encrypted_value=var["some_encrypted_secret_string"])
resources:
exampleSecretActionsEnvironmentSecret:
type: github:ActionsEnvironmentSecret
properties:
environment: example_environment
secretName: example_secret_name
plaintextValue: ${var.some_secret_string}
exampleSecretIndex/actionsEnvironmentSecretActionsEnvironmentSecret:
type: github:ActionsEnvironmentSecret
properties:
environment: example_environment
secretName: example_secret_name
encryptedValue: ${var.some_encrypted_secret_string}
using System.Collections.Generic;
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("repoEnvironment", new()
{
Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name),
Environment = "example_environment",
});
var testSecret = new Github.ActionsEnvironmentSecret("testSecret", new()
{
Repository = repo.Apply(getRepositoryResult => getRepositoryResult.Name),
Environment = repoEnvironment.Environment,
SecretName = "test_secret_name",
PlaintextValue = "%s",
});
});
package main
import (
"fmt"
"github.com/pulumi/pulumi-github/sdk/v4/go/github"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
repo, err := github.LookupRepository(ctx, &GetRepositoryArgs{
FullName: pulumi.StringRef("my-org/repo"),
}, nil)
if err != nil {
return err
}
repoEnvironment, err := github.NewRepositoryEnvironment(ctx, "repoEnvironment", &github.RepositoryEnvironmentArgs{
Repository: pulumi.String(repo.Name),
Environment: pulumi.String("example_environment"),
})
if err != nil {
return err
}
_, err = github.NewActionsEnvironmentSecret(ctx, "testSecret", &github.ActionsEnvironmentSecretArgs{
Repository: pulumi.String(repo.Name),
Environment: repoEnvironment.Environment,
SecretName: pulumi.String("test_secret_name"),
PlaintextValue: pulumi.String(fmt.Sprintf("%vs", "%")),
})
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.ActionsEnvironmentSecret;
import com.pulumi.github.ActionsEnvironmentSecretArgs;
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 testSecret = new ActionsEnvironmentSecret("testSecret", ActionsEnvironmentSecretArgs.builder()
.repository(repo.applyValue(getRepositoryResult -> getRepositoryResult.name()))
.environment(repoEnvironment.environment())
.secretName("test_secret_name")
.plaintextValue("%s")
.build());
}
}
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("repoEnvironment", {
repository: repo.then(repo => repo.name),
environment: "example_environment",
});
const testSecret = new github.ActionsEnvironmentSecret("testSecret", {
repository: repo.then(repo => repo.name),
environment: repoEnvironment.environment,
secretName: "test_secret_name",
plaintextValue: `%s`,
});
import pulumi
import pulumi_github as github
repo = github.get_repository(full_name="my-org/repo")
repo_environment = github.RepositoryEnvironment("repoEnvironment",
repository=repo.name,
environment="example_environment")
test_secret = github.ActionsEnvironmentSecret("testSecret",
repository=repo.name,
environment=repo_environment.environment,
secret_name="test_secret_name",
plaintext_value="%s")
resources:
repoEnvironment:
type: github:RepositoryEnvironment
properties:
repository: ${repo.name}
environment: example_environment
testSecret:
type: github:ActionsEnvironmentSecret
properties:
repository: ${repo.name}
environment: ${repoEnvironment.environment}
secretName: test_secret_name
plaintextValue: '%s'
variables:
repo:
Fn::Invoke:
Function: github:getRepository
Arguments:
fullName: my-org/repo
Create ActionsEnvironmentSecret Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ActionsEnvironmentSecret(name: string, args: ActionsEnvironmentSecretArgs, opts?: CustomResourceOptions);@overload
def ActionsEnvironmentSecret(resource_name: str,
args: ActionsEnvironmentSecretArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ActionsEnvironmentSecret(resource_name: str,
opts: Optional[ResourceOptions] = None,
environment: Optional[str] = None,
repository: Optional[str] = None,
secret_name: Optional[str] = None,
encrypted_value: Optional[str] = None,
plaintext_value: Optional[str] = None)func NewActionsEnvironmentSecret(ctx *Context, name string, args ActionsEnvironmentSecretArgs, opts ...ResourceOption) (*ActionsEnvironmentSecret, error)public ActionsEnvironmentSecret(string name, ActionsEnvironmentSecretArgs args, CustomResourceOptions? opts = null)
public ActionsEnvironmentSecret(String name, ActionsEnvironmentSecretArgs args)
public ActionsEnvironmentSecret(String name, ActionsEnvironmentSecretArgs args, CustomResourceOptions options)
type: github:ActionsEnvironmentSecret
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 ActionsEnvironmentSecretArgs
- 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 ActionsEnvironmentSecretArgs
- 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 ActionsEnvironmentSecretArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ActionsEnvironmentSecretArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ActionsEnvironmentSecretArgs
- 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 actionsEnvironmentSecretResource = new Github.ActionsEnvironmentSecret("actionsEnvironmentSecretResource", new()
{
Environment = "string",
Repository = "string",
SecretName = "string",
EncryptedValue = "string",
PlaintextValue = "string",
});
example, err := github.NewActionsEnvironmentSecret(ctx, "actionsEnvironmentSecretResource", &github.ActionsEnvironmentSecretArgs{
Environment: pulumi.String("string"),
Repository: pulumi.String("string"),
SecretName: pulumi.String("string"),
EncryptedValue: pulumi.String("string"),
PlaintextValue: pulumi.String("string"),
})
var actionsEnvironmentSecretResource = new ActionsEnvironmentSecret("actionsEnvironmentSecretResource", ActionsEnvironmentSecretArgs.builder()
.environment("string")
.repository("string")
.secretName("string")
.encryptedValue("string")
.plaintextValue("string")
.build());
actions_environment_secret_resource = github.ActionsEnvironmentSecret("actionsEnvironmentSecretResource",
environment="string",
repository="string",
secret_name="string",
encrypted_value="string",
plaintext_value="string")
const actionsEnvironmentSecretResource = new github.ActionsEnvironmentSecret("actionsEnvironmentSecretResource", {
environment: "string",
repository: "string",
secretName: "string",
encryptedValue: "string",
plaintextValue: "string",
});
type: github:ActionsEnvironmentSecret
properties:
encryptedValue: string
environment: string
plaintextValue: string
repository: string
secretName: string
ActionsEnvironmentSecret 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 ActionsEnvironmentSecret resource accepts the following input properties:
- Environment string
- Name of the environment.
- Repository string
- Name of the repository.
- Secret
Name string - Name of the secret.
- Encrypted
Value string - Encrypted value of the secret using the Github public key in Base64 format.
- Plaintext
Value string - Plaintext value of the secret to be encrypted.
- Environment string
- Name of the environment.
- Repository string
- Name of the repository.
- Secret
Name string - Name of the secret.
- Encrypted
Value string - Encrypted value of the secret using the Github public key in Base64 format.
- Plaintext
Value string - Plaintext value of the secret to be encrypted.
- environment String
- Name of the environment.
- repository String
- Name of the repository.
- secret
Name String - Name of the secret.
- encrypted
Value String - Encrypted value of the secret using the Github public key in Base64 format.
- plaintext
Value String - Plaintext value of the secret to be encrypted.
- environment string
- Name of the environment.
- repository string
- Name of the repository.
- secret
Name string - Name of the secret.
- encrypted
Value string - Encrypted value of the secret using the Github public key in Base64 format.
- plaintext
Value string - Plaintext value of the secret to be encrypted.
- environment str
- Name of the environment.
- repository str
- Name of the repository.
- secret_
name str - Name of the secret.
- encrypted_
value str - Encrypted value of the secret using the Github public key in Base64 format.
- plaintext_
value str - Plaintext value of the secret to be encrypted.
- environment String
- Name of the environment.
- repository String
- Name of the repository.
- secret
Name String - Name of the secret.
- encrypted
Value String - Encrypted value of the secret using the Github public key in Base64 format.
- plaintext
Value String - Plaintext value of the secret to be encrypted.
Outputs
All input properties are implicitly available as output properties. Additionally, the ActionsEnvironmentSecret resource produces the following output properties:
- created_
at str - Date of actions_environment_secret creation.
- id str
- The provider-assigned unique ID for this managed resource.
- updated_
at str - Date of actions_environment_secret update.
Look up Existing ActionsEnvironmentSecret Resource
Get an existing ActionsEnvironmentSecret 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?: ActionsEnvironmentSecretState, opts?: CustomResourceOptions): ActionsEnvironmentSecret@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
encrypted_value: Optional[str] = None,
environment: Optional[str] = None,
plaintext_value: Optional[str] = None,
repository: Optional[str] = None,
secret_name: Optional[str] = None,
updated_at: Optional[str] = None) -> ActionsEnvironmentSecretfunc GetActionsEnvironmentSecret(ctx *Context, name string, id IDInput, state *ActionsEnvironmentSecretState, opts ...ResourceOption) (*ActionsEnvironmentSecret, error)public static ActionsEnvironmentSecret Get(string name, Input<string> id, ActionsEnvironmentSecretState? state, CustomResourceOptions? opts = null)public static ActionsEnvironmentSecret get(String name, Output<String> id, ActionsEnvironmentSecretState state, CustomResourceOptions options)resources: _: type: github:ActionsEnvironmentSecret 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 of actions_environment_secret creation.
- Encrypted
Value string - Encrypted value of the secret using the Github public key in Base64 format.
- Environment string
- Name of the environment.
- Plaintext
Value string - Plaintext value of the secret to be encrypted.
- Repository string
- Name of the repository.
- Secret
Name string - Name of the secret.
- Updated
At string - Date of actions_environment_secret update.
- Created
At string - Date of actions_environment_secret creation.
- Encrypted
Value string - Encrypted value of the secret using the Github public key in Base64 format.
- Environment string
- Name of the environment.
- Plaintext
Value string - Plaintext value of the secret to be encrypted.
- Repository string
- Name of the repository.
- Secret
Name string - Name of the secret.
- Updated
At string - Date of actions_environment_secret update.
- created
At String - Date of actions_environment_secret creation.
- encrypted
Value String - Encrypted value of the secret using the Github public key in Base64 format.
- environment String
- Name of the environment.
- plaintext
Value String - Plaintext value of the secret to be encrypted.
- repository String
- Name of the repository.
- secret
Name String - Name of the secret.
- updated
At String - Date of actions_environment_secret update.
- created
At string - Date of actions_environment_secret creation.
- encrypted
Value string - Encrypted value of the secret using the Github public key in Base64 format.
- environment string
- Name of the environment.
- plaintext
Value string - Plaintext value of the secret to be encrypted.
- repository string
- Name of the repository.
- secret
Name string - Name of the secret.
- updated
At string - Date of actions_environment_secret update.
- created_
at str - Date of actions_environment_secret creation.
- encrypted_
value str - Encrypted value of the secret using the Github public key in Base64 format.
- environment str
- Name of the environment.
- plaintext_
value str - Plaintext value of the secret to be encrypted.
- repository str
- Name of the repository.
- secret_
name str - Name of the secret.
- updated_
at str - Date of actions_environment_secret update.
- created
At String - Date of actions_environment_secret creation.
- encrypted
Value String - Encrypted value of the secret using the Github public key in Base64 format.
- environment String
- Name of the environment.
- plaintext
Value String - Plaintext value of the secret to be encrypted.
- repository String
- Name of the repository.
- secret
Name String - Name of the secret.
- updated
At String - Date of actions_environment_secret update.
Package Details
- Repository
- GitHub pulumi/pulumi-github
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
githubTerraform Provider.
published on Monday, Mar 9, 2026 by Pulumi
