1. Packages
  2. Github Provider
  3. API Docs
  4. IssueLabel
GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi

github.IssueLabel

Explore with Pulumi AI

github logo
GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi

    Provides a GitHub issue label resource.

    This resource allows you to create and manage issue labels within your GitHub organization.

    Issue labels are keyed off of their “name”, so pre-existing issue labels result in a 422 HTTP error if they exist outside of Pulumi. Normally this would not be an issue, except new repositories are created with a “default” set of labels, and those labels easily conflict with custom ones.

    This resource will first check if the label exists, and then issue an update, otherwise it will create.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    // Create a new, red colored label
    const testRepo = new github.IssueLabel("test_repo", {
        repository: "test-repo",
        name: "Urgent",
        color: "FF0000",
    });
    
    import pulumi
    import pulumi_github as github
    
    # Create a new, red colored label
    test_repo = github.IssueLabel("test_repo",
        repository="test-repo",
        name="Urgent",
        color="FF0000")
    
    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 {
    		// Create a new, red colored label
    		_, err := github.NewIssueLabel(ctx, "test_repo", &github.IssueLabelArgs{
    			Repository: pulumi.String("test-repo"),
    			Name:       pulumi.String("Urgent"),
    			Color:      pulumi.String("FF0000"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        // Create a new, red colored label
        var testRepo = new Github.IssueLabel("test_repo", new()
        {
            Repository = "test-repo",
            Name = "Urgent",
            Color = "FF0000",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.IssueLabel;
    import com.pulumi.github.IssueLabelArgs;
    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) {
            // Create a new, red colored label
            var testRepo = new IssueLabel("testRepo", IssueLabelArgs.builder()
                .repository("test-repo")
                .name("Urgent")
                .color("FF0000")
                .build());
    
        }
    }
    
    resources:
      # Create a new, red colored label
      testRepo:
        type: github:IssueLabel
        name: test_repo
        properties:
          repository: test-repo
          name: Urgent
          color: FF0000
    

    Create IssueLabel Resource

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

    Constructor syntax

    new IssueLabel(name: string, args: IssueLabelArgs, opts?: CustomResourceOptions);
    @overload
    def IssueLabel(resource_name: str,
                   args: IssueLabelArgs,
                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def IssueLabel(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   color: Optional[str] = None,
                   repository: Optional[str] = None,
                   description: Optional[str] = None,
                   name: Optional[str] = None)
    func NewIssueLabel(ctx *Context, name string, args IssueLabelArgs, opts ...ResourceOption) (*IssueLabel, error)
    public IssueLabel(string name, IssueLabelArgs args, CustomResourceOptions? opts = null)
    public IssueLabel(String name, IssueLabelArgs args)
    public IssueLabel(String name, IssueLabelArgs args, CustomResourceOptions options)
    
    type: github:IssueLabel
    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 IssueLabelArgs
    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 IssueLabelArgs
    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 IssueLabelArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IssueLabelArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IssueLabelArgs
    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 issueLabelResource = new Github.IssueLabel("issueLabelResource", new()
    {
        Color = "string",
        Repository = "string",
        Description = "string",
        Name = "string",
    });
    
    example, err := github.NewIssueLabel(ctx, "issueLabelResource", &github.IssueLabelArgs{
    	Color:       pulumi.String("string"),
    	Repository:  pulumi.String("string"),
    	Description: pulumi.String("string"),
    	Name:        pulumi.String("string"),
    })
    
    var issueLabelResource = new IssueLabel("issueLabelResource", IssueLabelArgs.builder()
        .color("string")
        .repository("string")
        .description("string")
        .name("string")
        .build());
    
    issue_label_resource = github.IssueLabel("issueLabelResource",
        color="string",
        repository="string",
        description="string",
        name="string")
    
    const issueLabelResource = new github.IssueLabel("issueLabelResource", {
        color: "string",
        repository: "string",
        description: "string",
        name: "string",
    });
    
    type: github:IssueLabel
    properties:
        color: string
        description: string
        name: string
        repository: string
    

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

    Color string
    A 6 character hex code, without the leading #, identifying the color of the label.
    Repository string
    The GitHub repository
    Description string
    A short description of the label.
    Name string
    The name of the label.
    Color string
    A 6 character hex code, without the leading #, identifying the color of the label.
    Repository string
    The GitHub repository
    Description string
    A short description of the label.
    Name string
    The name of the label.
    color String
    A 6 character hex code, without the leading #, identifying the color of the label.
    repository String
    The GitHub repository
    description String
    A short description of the label.
    name String
    The name of the label.
    color string
    A 6 character hex code, without the leading #, identifying the color of the label.
    repository string
    The GitHub repository
    description string
    A short description of the label.
    name string
    The name of the label.
    color str
    A 6 character hex code, without the leading #, identifying the color of the label.
    repository str
    The GitHub repository
    description str
    A short description of the label.
    name str
    The name of the label.
    color String
    A 6 character hex code, without the leading #, identifying the color of the label.
    repository String
    The GitHub repository
    description String
    A short description of the label.
    name String
    The name of the label.

    Outputs

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

    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    Url string
    The URL to the issue label
    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    Url string
    The URL to the issue label
    etag String
    id String
    The provider-assigned unique ID for this managed resource.
    url String
    The URL to the issue label
    etag string
    id string
    The provider-assigned unique ID for this managed resource.
    url string
    The URL to the issue label
    etag str
    id str
    The provider-assigned unique ID for this managed resource.
    url str
    The URL to the issue label
    etag String
    id String
    The provider-assigned unique ID for this managed resource.
    url String
    The URL to the issue label

    Look up Existing IssueLabel Resource

    Get an existing IssueLabel 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?: IssueLabelState, opts?: CustomResourceOptions): IssueLabel
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            color: Optional[str] = None,
            description: Optional[str] = None,
            etag: Optional[str] = None,
            name: Optional[str] = None,
            repository: Optional[str] = None,
            url: Optional[str] = None) -> IssueLabel
    func GetIssueLabel(ctx *Context, name string, id IDInput, state *IssueLabelState, opts ...ResourceOption) (*IssueLabel, error)
    public static IssueLabel Get(string name, Input<string> id, IssueLabelState? state, CustomResourceOptions? opts = null)
    public static IssueLabel get(String name, Output<String> id, IssueLabelState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    Color string
    A 6 character hex code, without the leading #, identifying the color of the label.
    Description string
    A short description of the label.
    Etag string
    Name string
    The name of the label.
    Repository string
    The GitHub repository
    Url string
    The URL to the issue label
    Color string
    A 6 character hex code, without the leading #, identifying the color of the label.
    Description string
    A short description of the label.
    Etag string
    Name string
    The name of the label.
    Repository string
    The GitHub repository
    Url string
    The URL to the issue label
    color String
    A 6 character hex code, without the leading #, identifying the color of the label.
    description String
    A short description of the label.
    etag String
    name String
    The name of the label.
    repository String
    The GitHub repository
    url String
    The URL to the issue label
    color string
    A 6 character hex code, without the leading #, identifying the color of the label.
    description string
    A short description of the label.
    etag string
    name string
    The name of the label.
    repository string
    The GitHub repository
    url string
    The URL to the issue label
    color str
    A 6 character hex code, without the leading #, identifying the color of the label.
    description str
    A short description of the label.
    etag str
    name str
    The name of the label.
    repository str
    The GitHub repository
    url str
    The URL to the issue label
    color String
    A 6 character hex code, without the leading #, identifying the color of the label.
    description String
    A short description of the label.
    etag String
    name String
    The name of the label.
    repository String
    The GitHub repository
    url String
    The URL to the issue label

    Import

    GitHub Issue Labels can be imported using an ID made up of repository:name, e.g.

    $ pulumi import github:index/issueLabel:IssueLabel panic_label terraform:panic
    

    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.
    github logo
    GitHub v6.3.2 published on Friday, Oct 11, 2024 by Pulumi