1. Packages
  2. Github Provider
  3. API Docs
  4. ActionsVariable
GitHub v6.7.0 published on Friday, Feb 28, 2025 by Pulumi

github.ActionsVariable

Explore with Pulumi AI

This resource allows you to create and manage GitHub Actions variables within your GitHub repositories. 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.ActionsVariable("example_variable", {
    repository: "example_repository",
    variableName: "example_variable_name",
    value: "example_variable_value",
});
Copy
import pulumi
import pulumi_github as github

example_variable = github.ActionsVariable("example_variable",
    repository="example_repository",
    variable_name="example_variable_name",
    value="example_variable_value")
Copy
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.NewActionsVariable(ctx, "example_variable", &github.ActionsVariableArgs{
			Repository:   pulumi.String("example_repository"),
			VariableName: pulumi.String("example_variable_name"),
			Value:        pulumi.String("example_variable_value"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;

return await Deployment.RunAsync(() => 
{
    var exampleVariable = new Github.ActionsVariable("example_variable", new()
    {
        Repository = "example_repository",
        VariableName = "example_variable_name",
        Value = "example_variable_value",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.github.ActionsVariable;
import com.pulumi.github.ActionsVariableArgs;
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 ActionsVariable("exampleVariable", ActionsVariableArgs.builder()
            .repository("example_repository")
            .variableName("example_variable_name")
            .value("example_variable_value")
            .build());

    }
}
Copy
resources:
  exampleVariable:
    type: github:ActionsVariable
    name: example_variable
    properties:
      repository: example_repository
      variableName: example_variable_name
      value: example_variable_value
Copy

Create ActionsVariable Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ActionsVariable(name: string, args: ActionsVariableArgs, opts?: CustomResourceOptions);
@overload
def ActionsVariable(resource_name: str,
                    args: ActionsVariableArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def ActionsVariable(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    repository: Optional[str] = None,
                    value: Optional[str] = None,
                    variable_name: Optional[str] = None)
func NewActionsVariable(ctx *Context, name string, args ActionsVariableArgs, opts ...ResourceOption) (*ActionsVariable, error)
public ActionsVariable(string name, ActionsVariableArgs args, CustomResourceOptions? opts = null)
public ActionsVariable(String name, ActionsVariableArgs args)
public ActionsVariable(String name, ActionsVariableArgs args, CustomResourceOptions options)
type: github:ActionsVariable
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ActionsVariableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ActionsVariableArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ActionsVariableArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ActionsVariableArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ActionsVariableArgs
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 actionsVariableResource = new Github.ActionsVariable("actionsVariableResource", new()
{
    Repository = "string",
    Value = "string",
    VariableName = "string",
});
Copy
example, err := github.NewActionsVariable(ctx, "actionsVariableResource", &github.ActionsVariableArgs{
	Repository:   pulumi.String("string"),
	Value:        pulumi.String("string"),
	VariableName: pulumi.String("string"),
})
Copy
var actionsVariableResource = new ActionsVariable("actionsVariableResource", ActionsVariableArgs.builder()
    .repository("string")
    .value("string")
    .variableName("string")
    .build());
Copy
actions_variable_resource = github.ActionsVariable("actionsVariableResource",
    repository="string",
    value="string",
    variable_name="string")
Copy
const actionsVariableResource = new github.ActionsVariable("actionsVariableResource", {
    repository: "string",
    value: "string",
    variableName: "string",
});
Copy
type: github:ActionsVariable
properties:
    repository: string
    value: string
    variableName: string
Copy

ActionsVariable 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 ActionsVariable resource accepts the following input properties:

Repository This property is required. string
Name of the repository
Value This property is required. string
Value of the variable
VariableName
This property is required.
Changes to this property will trigger replacement.
string
Name of the variable
Repository This property is required. string
Name of the repository
Value This property is required. string
Value of the variable
VariableName
This property is required.
Changes to this property will trigger replacement.
string
Name of the variable
repository This property is required. String
Name of the repository
value This property is required. String
Value of the variable
variableName
This property is required.
Changes to this property will trigger replacement.
String
Name of the variable
repository This property is required. string
Name of the repository
value This property is required. string
Value of the variable
variableName
This property is required.
Changes to this property will trigger replacement.
string
Name of the variable
repository This property is required. str
Name of the repository
value This property is required. str
Value of the variable
variable_name
This property is required.
Changes to this property will trigger replacement.
str
Name of the variable
repository This property is required. String
Name of the repository
value This property is required. String
Value of the variable
variableName
This property is required.
Changes to this property will trigger replacement.
String
Name of the variable

Outputs

All input properties are implicitly available as output properties. Additionally, the ActionsVariable resource produces the following output properties:

CreatedAt string
Date of actions_variable creation.
Id string
The provider-assigned unique ID for this managed resource.
UpdatedAt string
Date of actions_variable update.
CreatedAt string
Date of actions_variable creation.
Id string
The provider-assigned unique ID for this managed resource.
UpdatedAt string
Date of actions_variable update.
createdAt String
Date of actions_variable creation.
id String
The provider-assigned unique ID for this managed resource.
updatedAt String
Date of actions_variable update.
createdAt string
Date of actions_variable creation.
id string
The provider-assigned unique ID for this managed resource.
updatedAt string
Date of actions_variable update.
created_at str
Date of actions_variable creation.
id str
The provider-assigned unique ID for this managed resource.
updated_at str
Date of actions_variable update.
createdAt String
Date of actions_variable creation.
id String
The provider-assigned unique ID for this managed resource.
updatedAt String
Date of actions_variable update.

Look up Existing ActionsVariable Resource

Get an existing ActionsVariable 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?: ActionsVariableState, opts?: CustomResourceOptions): ActionsVariable
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        created_at: Optional[str] = None,
        repository: Optional[str] = None,
        updated_at: Optional[str] = None,
        value: Optional[str] = None,
        variable_name: Optional[str] = None) -> ActionsVariable
func GetActionsVariable(ctx *Context, name string, id IDInput, state *ActionsVariableState, opts ...ResourceOption) (*ActionsVariable, error)
public static ActionsVariable Get(string name, Input<string> id, ActionsVariableState? state, CustomResourceOptions? opts = null)
public static ActionsVariable get(String name, Output<String> id, ActionsVariableState state, CustomResourceOptions options)
resources:  _:    type: github:ActionsVariable    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
CreatedAt string
Date of actions_variable creation.
Repository string
Name of the repository
UpdatedAt string
Date of actions_variable update.
Value string
Value of the variable
VariableName Changes to this property will trigger replacement. string
Name of the variable
CreatedAt string
Date of actions_variable creation.
Repository string
Name of the repository
UpdatedAt string
Date of actions_variable update.
Value string
Value of the variable
VariableName Changes to this property will trigger replacement. string
Name of the variable
createdAt String
Date of actions_variable creation.
repository String
Name of the repository
updatedAt String
Date of actions_variable update.
value String
Value of the variable
variableName Changes to this property will trigger replacement. String
Name of the variable
createdAt string
Date of actions_variable creation.
repository string
Name of the repository
updatedAt string
Date of actions_variable update.
value string
Value of the variable
variableName Changes to this property will trigger replacement. string
Name of the variable
created_at str
Date of actions_variable creation.
repository str
Name of the repository
updated_at str
Date of actions_variable update.
value str
Value of the variable
variable_name Changes to this property will trigger replacement. str
Name of the variable
createdAt String
Date of actions_variable creation.
repository String
Name of the repository
updatedAt String
Date of actions_variable update.
value String
Value of the variable
variableName Changes to this property will trigger replacement. String
Name of the variable

Import

GitHub Actions variables can be imported using an ID made up of repository:variable_name, e.g.

$ pulumi import github:index/actionsVariable:ActionsVariable myvariable myrepo:myvariable
Copy

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 github Terraform Provider.