github_actions_environment_variable

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

resource "github_actions_environment_variable" "example_variable" {
  environment       = "example_environment"
  variable_name     = "example_variable_name"
  value             = "example_variable_value"
}
data "github_repository" "repo" {
  full_name = "my-org/repo"
}

resource "github_repository_environment" "repo_environment" {
  repository       = data.github_repository.repo.name
  environment      = "example_environment"
}

resource "github_actions_environment_variable" "example_variable" {
  repository       = data.github_repository.repo.name
  environment      = github_repository_environment.repo_environment.environment
  variable_name    = "example_variable_name"
  value            = "example_variable_value"
}

Argument Reference

The following arguments are supported:

Attributes Reference

Import

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

$ terraform import github_actions_environment_variable.test_variable myrepo:myenv:myvariable