Repository Custom Property
This resource allows you to create and manage a specific custom property for a GitHub repository.
Example Usage
Note that this assumes there already is a custom property defined on the org level called
my-cool-property
of typestring
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const example = new github.Repository("example", {
name: "example",
description: "My awesome codebase",
});
const string = new github.RepositoryCustomProperty("string", {
repository: example.name,
propertyName: "my-cool-property",
propertyType: "string",
propertyValues: ["test"],
});
import pulumi
import pulumi_github as github
example = github.Repository("example",
name="example",
description="My awesome codebase")
string = github.RepositoryCustomProperty("string",
repository=example.name,
property_name="my-cool-property",
property_type="string",
property_values=["test"])
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var example = new Github.Repository("example", new()
{
Name = "example",
Description = "My awesome codebase",
});
var @string = new Github.RepositoryCustomProperty("string", new()
{
Repository = example.Name,
PropertyName = "my-cool-property",
PropertyType = "string",
PropertyValues = new[]
{
"test",
},
});
});
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.NewRepository(ctx, "example", &github.RepositoryArgs{
Name: pulumi.String("example"),
Description: pulumi.String("My awesome codebase"),
})
if err != nil {
return err
}
_, err = github.NewRepositoryCustomProperty(ctx, "string", &github.RepositoryCustomPropertyArgs{
Repository: example.Name,
PropertyName: pulumi.String("my-cool-property"),
PropertyType: pulumi.String("string"),
PropertyValues: pulumi.StringArray{
pulumi.String("test"),
},
})
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.Repository;
import com.pulumi.github.RepositoryArgs;
import com.pulumi.github.RepositoryCustomProperty;
import com.pulumi.github.RepositoryCustomPropertyArgs;
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 Repository("example", RepositoryArgs.builder()
.name("example")
.description("My awesome codebase")
.build());
var string = new RepositoryCustomProperty("string", RepositoryCustomPropertyArgs.builder()
.repository(example.name())
.propertyName("my-cool-property")
.propertyType("string")
.propertyValues("test")
.build());
}
}
resources:
example:
type: github:Repository
properties:
name: example
description: My awesome codebase
string:
type: github:RepositoryCustomProperty
properties:
repository: ${example.name}
propertyName: my-cool-property
propertyType: string
propertyValues:
- test
Import
GitHub Repository Custom Property can be imported using an ID made up of a comibnation of the names of the organization, repository, custom property separated by a :
character, e.g.
$ pulumi import github:index/repositoryCustomProperty:RepositoryCustomProperty example <organization-name>:<repo-name>:<custom-property-name>
Properties
Name of the custom property. Note that a pre-requisiste for this resource is that a custom property of this name has already been defined on the organization level
Type of the custom property. Can be one of single_select
, multi_select
, string
, or true_false
Value of the custom property in the form of an array. Properties of type single_select
, string
, and true_false
are represented as a string array of length 1
The repository of the environment.