1. Packages
  2. GitHub
  3. API Docs
  4. IssueLabels
GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi

github.IssueLabels

Explore with Pulumi AI

github logo
GitHub v6.1.0 published on Monday, Mar 11, 2024 by Pulumi

    Provides GitHub issue labels resource.

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

    Note: github.IssueLabels cannot be used in conjunction with github.IssueLabel or they will fight over what your policy should be.

    This resource is authoritative. For adding a label to a repo in a non-authoritative manner, use github.IssueLabel instead.

    If you change the case of a label’s name, its’ color, or description, this resource will edit the existing label to match the new values. However, if you change the name of a label, this resource will create a new label with the new name and delete the old label. Beware that this will remove the label from any issues it was previously attached to.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    // Create a new, red colored label
    const testRepo = new github.IssueLabels("testRepo", {
        labels: [
            {
                color: "FF0000",
                name: "Urgent",
            },
            {
                color: "FF0000",
                name: "Critical",
            },
        ],
        repository: "test-repo",
    });
    
    import pulumi
    import pulumi_github as github
    
    # Create a new, red colored label
    test_repo = github.IssueLabels("testRepo",
        labels=[
            github.IssueLabelsLabelArgs(
                color="FF0000",
                name="Urgent",
            ),
            github.IssueLabelsLabelArgs(
                color="FF0000",
                name="Critical",
            ),
        ],
        repository="test-repo")
    
    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.NewIssueLabels(ctx, "testRepo", &github.IssueLabelsArgs{
    			Labels: github.IssueLabelsLabelArray{
    				&github.IssueLabelsLabelArgs{
    					Color: pulumi.String("FF0000"),
    					Name:  pulumi.String("Urgent"),
    				},
    				&github.IssueLabelsLabelArgs{
    					Color: pulumi.String("FF0000"),
    					Name:  pulumi.String("Critical"),
    				},
    			},
    			Repository: pulumi.String("test-repo"),
    		})
    		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.IssueLabels("testRepo", new()
        {
            Labels = new[]
            {
                new Github.Inputs.IssueLabelsLabelArgs
                {
                    Color = "FF0000",
                    Name = "Urgent",
                },
                new Github.Inputs.IssueLabelsLabelArgs
                {
                    Color = "FF0000",
                    Name = "Critical",
                },
            },
            Repository = "test-repo",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.IssueLabels;
    import com.pulumi.github.IssueLabelsArgs;
    import com.pulumi.github.inputs.IssueLabelsLabelArgs;
    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 testRepo = new IssueLabels("testRepo", IssueLabelsArgs.builder()        
                .labels(            
                    IssueLabelsLabelArgs.builder()
                        .color("FF0000")
                        .name("Urgent")
                        .build(),
                    IssueLabelsLabelArgs.builder()
                        .color("FF0000")
                        .name("Critical")
                        .build())
                .repository("test-repo")
                .build());
    
        }
    }
    
    resources:
      # Create a new, red colored label
      testRepo:
        type: github:IssueLabels
        properties:
          labels:
            - color: FF0000
              name: Urgent
            - color: FF0000
              name: Critical
          repository: test-repo
    

    Create IssueLabels Resource

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

    Constructor syntax

    new IssueLabels(name: string, args: IssueLabelsArgs, opts?: CustomResourceOptions);
    @overload
    def IssueLabels(resource_name: str,
                    args: IssueLabelsArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def IssueLabels(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    repository: Optional[str] = None,
                    labels: Optional[Sequence[IssueLabelsLabelArgs]] = None)
    func NewIssueLabels(ctx *Context, name string, args IssueLabelsArgs, opts ...ResourceOption) (*IssueLabels, error)
    public IssueLabels(string name, IssueLabelsArgs args, CustomResourceOptions? opts = null)
    public IssueLabels(String name, IssueLabelsArgs args)
    public IssueLabels(String name, IssueLabelsArgs args, CustomResourceOptions options)
    
    type: github:IssueLabels
    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 IssueLabelsArgs
    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 IssueLabelsArgs
    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 IssueLabelsArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args IssueLabelsArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args IssueLabelsArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var issueLabelsResource = new Github.IssueLabels("issueLabelsResource", new()
    {
        Repository = "string",
        Labels = new[]
        {
            new Github.Inputs.IssueLabelsLabelArgs
            {
                Color = "string",
                Name = "string",
                Description = "string",
                Url = "string",
            },
        },
    });
    
    example, err := github.NewIssueLabels(ctx, "issueLabelsResource", &github.IssueLabelsArgs{
    	Repository: pulumi.String("string"),
    	Labels: github.IssueLabelsLabelArray{
    		&github.IssueLabelsLabelArgs{
    			Color:       pulumi.String("string"),
    			Name:        pulumi.String("string"),
    			Description: pulumi.String("string"),
    			Url:         pulumi.String("string"),
    		},
    	},
    })
    
    var issueLabelsResource = new IssueLabels("issueLabelsResource", IssueLabelsArgs.builder()        
        .repository("string")
        .labels(IssueLabelsLabelArgs.builder()
            .color("string")
            .name("string")
            .description("string")
            .url("string")
            .build())
        .build());
    
    issue_labels_resource = github.IssueLabels("issueLabelsResource",
        repository="string",
        labels=[github.IssueLabelsLabelArgs(
            color="string",
            name="string",
            description="string",
            url="string",
        )])
    
    const issueLabelsResource = new github.IssueLabels("issueLabelsResource", {
        repository: "string",
        labels: [{
            color: "string",
            name: "string",
            description: "string",
            url: "string",
        }],
    });
    
    type: github:IssueLabels
    properties:
        labels:
            - color: string
              description: string
              name: string
              url: string
        repository: string
    

    IssueLabels Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The IssueLabels resource accepts the following input properties:

    Repository string
    The GitHub repository
    Labels List<IssueLabelsLabel>
    List of labels
    Repository string
    The GitHub repository
    Labels []IssueLabelsLabelArgs
    List of labels
    repository String
    The GitHub repository
    labels List<IssueLabelsLabel>
    List of labels
    repository string
    The GitHub repository
    labels IssueLabelsLabel[]
    List of labels
    repository str
    The GitHub repository
    labels Sequence[IssueLabelsLabelArgs]
    List of labels
    repository String
    The GitHub repository
    labels List<Property Map>
    List of labels

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing IssueLabels Resource

    Get an existing IssueLabels 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?: IssueLabelsState, opts?: CustomResourceOptions): IssueLabels
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            labels: Optional[Sequence[IssueLabelsLabelArgs]] = None,
            repository: Optional[str] = None) -> IssueLabels
    func GetIssueLabels(ctx *Context, name string, id IDInput, state *IssueLabelsState, opts ...ResourceOption) (*IssueLabels, error)
    public static IssueLabels Get(string name, Input<string> id, IssueLabelsState? state, CustomResourceOptions? opts = null)
    public static IssueLabels get(String name, Output<String> id, IssueLabelsState 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:
    Labels List<IssueLabelsLabel>
    List of labels
    Repository string
    The GitHub repository
    Labels []IssueLabelsLabelArgs
    List of labels
    Repository string
    The GitHub repository
    labels List<IssueLabelsLabel>
    List of labels
    repository String
    The GitHub repository
    labels IssueLabelsLabel[]
    List of labels
    repository string
    The GitHub repository
    labels Sequence[IssueLabelsLabelArgs]
    List of labels
    repository str
    The GitHub repository
    labels List<Property Map>
    List of labels
    repository String
    The GitHub repository

    Supporting Types

    IssueLabelsLabel, IssueLabelsLabelArgs

    Color string
    A 6 character hex code, without the leading #, identifying the color of the label.
    Name string
    The name of the label.
    Description string
    A short description of the label.
    Url string
    The URL to the issue label
    Color string
    A 6 character hex code, without the leading #, identifying the color of the label.
    Name string
    The name of the label.
    Description string
    A short description of the label.
    Url string
    The URL to the issue label
    color String
    A 6 character hex code, without the leading #, identifying the color of the label.
    name String
    The name of the label.
    description String
    A short description of the label.
    url String
    The URL to the issue label
    color string
    A 6 character hex code, without the leading #, identifying the color of the label.
    name string
    The name of the label.
    description string
    A short description of the label.
    url string
    The URL to the issue label
    color str
    A 6 character hex code, without the leading #, identifying the color of the label.
    name str
    The name of the label.
    description str
    A short description of the label.
    url str
    The URL to the issue label
    color String
    A 6 character hex code, without the leading #, identifying the color of the label.
    name String
    The name of the label.
    description String
    A short description of the label.
    url String
    The URL to the issue label

    Import

    GitHub Issue Labels can be imported using the repository name, e.g.

    $ pulumi import github:index/issueLabels:IssueLabels test_repo test_repo
    

    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.1.0 published on Monday, Mar 11, 2024 by Pulumi