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

github.ProjectCard

Explore with Pulumi AI

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

    This resource allows you to create and manage cards for GitHub projects.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const project = new github.OrganizationProject("project", {body: "This is an organization project."});
    const column = new github.ProjectColumn("column", {projectId: project.id});
    const card = new github.ProjectCard("card", {
        columnId: column.columnId,
        note: "## Unaccepted πŸ‘‡",
    });
    
    import pulumi
    import pulumi_github as github
    
    project = github.OrganizationProject("project", body="This is an organization project.")
    column = github.ProjectColumn("column", project_id=project.id)
    card = github.ProjectCard("card",
        column_id=column.column_id,
        note="## Unaccepted πŸ‘‡")
    
    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 {
    		project, err := github.NewOrganizationProject(ctx, "project", &github.OrganizationProjectArgs{
    			Body: pulumi.String("This is an organization project."),
    		})
    		if err != nil {
    			return err
    		}
    		column, err := github.NewProjectColumn(ctx, "column", &github.ProjectColumnArgs{
    			ProjectId: project.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = github.NewProjectCard(ctx, "card", &github.ProjectCardArgs{
    			ColumnId: column.ColumnId,
    			Note:     pulumi.String("## Unaccepted πŸ‘‡"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var project = new Github.OrganizationProject("project", new()
        {
            Body = "This is an organization project.",
        });
    
        var column = new Github.ProjectColumn("column", new()
        {
            ProjectId = project.Id,
        });
    
        var card = new Github.ProjectCard("card", new()
        {
            ColumnId = column.ColumnId,
            Note = "## Unaccepted πŸ‘‡",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.github.OrganizationProject;
    import com.pulumi.github.OrganizationProjectArgs;
    import com.pulumi.github.ProjectColumn;
    import com.pulumi.github.ProjectColumnArgs;
    import com.pulumi.github.ProjectCard;
    import com.pulumi.github.ProjectCardArgs;
    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 project = new OrganizationProject("project", OrganizationProjectArgs.builder()        
                .body("This is an organization project.")
                .build());
    
            var column = new ProjectColumn("column", ProjectColumnArgs.builder()        
                .projectId(project.id())
                .build());
    
            var card = new ProjectCard("card", ProjectCardArgs.builder()        
                .columnId(column.columnId())
                .note("## Unaccepted πŸ‘‡")
                .build());
    
        }
    }
    
    resources:
      project:
        type: github:OrganizationProject
        properties:
          body: This is an organization project.
      column:
        type: github:ProjectColumn
        properties:
          projectId: ${project.id}
      card:
        type: github:ProjectCard
        properties:
          columnId: ${column.columnId}
          note: "## Unaccepted \U0001F447"
    

    Adding An Issue To A Project

    import * as pulumi from "@pulumi/pulumi";
    import * as github from "@pulumi/github";
    
    const testRepository = new github.Repository("testRepository", {
        hasProjects: true,
        hasIssues: true,
    });
    const testIssue = new github.Issue("testIssue", {
        repository: testRepository.id,
        title: "Test issue title",
        body: "Test issue body",
    });
    const testRepositoryProject = new github.RepositoryProject("testRepositoryProject", {
        repository: testRepository.name,
        body: "this is a test project",
    });
    const testProjectColumn = new github.ProjectColumn("testProjectColumn", {projectId: testRepositoryProject.id});
    const testProjectCard = new github.ProjectCard("testProjectCard", {
        columnId: testProjectColumn.columnId,
        contentId: testIssue.issueId,
        contentType: "Issue",
    });
    
    import pulumi
    import pulumi_github as github
    
    test_repository = github.Repository("testRepository",
        has_projects=True,
        has_issues=True)
    test_issue = github.Issue("testIssue",
        repository=test_repository.id,
        title="Test issue title",
        body="Test issue body")
    test_repository_project = github.RepositoryProject("testRepositoryProject",
        repository=test_repository.name,
        body="this is a test project")
    test_project_column = github.ProjectColumn("testProjectColumn", project_id=test_repository_project.id)
    test_project_card = github.ProjectCard("testProjectCard",
        column_id=test_project_column.column_id,
        content_id=test_issue.issue_id,
        content_type="Issue")
    
    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 {
    		testRepository, err := github.NewRepository(ctx, "testRepository", &github.RepositoryArgs{
    			HasProjects: pulumi.Bool(true),
    			HasIssues:   pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		testIssue, err := github.NewIssue(ctx, "testIssue", &github.IssueArgs{
    			Repository: testRepository.ID(),
    			Title:      pulumi.String("Test issue title"),
    			Body:       pulumi.String("Test issue body"),
    		})
    		if err != nil {
    			return err
    		}
    		testRepositoryProject, err := github.NewRepositoryProject(ctx, "testRepositoryProject", &github.RepositoryProjectArgs{
    			Repository: testRepository.Name,
    			Body:       pulumi.String("this is a test project"),
    		})
    		if err != nil {
    			return err
    		}
    		testProjectColumn, err := github.NewProjectColumn(ctx, "testProjectColumn", &github.ProjectColumnArgs{
    			ProjectId: testRepositoryProject.ID(),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = github.NewProjectCard(ctx, "testProjectCard", &github.ProjectCardArgs{
    			ColumnId:    testProjectColumn.ColumnId,
    			ContentId:   testIssue.IssueId,
    			ContentType: pulumi.String("Issue"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Github = Pulumi.Github;
    
    return await Deployment.RunAsync(() => 
    {
        var testRepository = new Github.Repository("testRepository", new()
        {
            HasProjects = true,
            HasIssues = true,
        });
    
        var testIssue = new Github.Issue("testIssue", new()
        {
            Repository = testRepository.Id,
            Title = "Test issue title",
            Body = "Test issue body",
        });
    
        var testRepositoryProject = new Github.RepositoryProject("testRepositoryProject", new()
        {
            Repository = testRepository.Name,
            Body = "this is a test project",
        });
    
        var testProjectColumn = new Github.ProjectColumn("testProjectColumn", new()
        {
            ProjectId = testRepositoryProject.Id,
        });
    
        var testProjectCard = new Github.ProjectCard("testProjectCard", new()
        {
            ColumnId = testProjectColumn.ColumnId,
            ContentId = testIssue.IssueId,
            ContentType = "Issue",
        });
    
    });
    
    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.Issue;
    import com.pulumi.github.IssueArgs;
    import com.pulumi.github.RepositoryProject;
    import com.pulumi.github.RepositoryProjectArgs;
    import com.pulumi.github.ProjectColumn;
    import com.pulumi.github.ProjectColumnArgs;
    import com.pulumi.github.ProjectCard;
    import com.pulumi.github.ProjectCardArgs;
    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 testRepository = new Repository("testRepository", RepositoryArgs.builder()        
                .hasProjects(true)
                .hasIssues(true)
                .build());
    
            var testIssue = new Issue("testIssue", IssueArgs.builder()        
                .repository(testRepository.id())
                .title("Test issue title")
                .body("Test issue body")
                .build());
    
            var testRepositoryProject = new RepositoryProject("testRepositoryProject", RepositoryProjectArgs.builder()        
                .repository(testRepository.name())
                .body("this is a test project")
                .build());
    
            var testProjectColumn = new ProjectColumn("testProjectColumn", ProjectColumnArgs.builder()        
                .projectId(testRepositoryProject.id())
                .build());
    
            var testProjectCard = new ProjectCard("testProjectCard", ProjectCardArgs.builder()        
                .columnId(testProjectColumn.columnId())
                .contentId(testIssue.issueId())
                .contentType("Issue")
                .build());
    
        }
    }
    
    resources:
      testRepository:
        type: github:Repository
        properties:
          hasProjects: true
          hasIssues: true
      testIssue:
        type: github:Issue
        properties:
          repository: ${testRepository.id}
          title: Test issue title
          body: Test issue body
      testRepositoryProject:
        type: github:RepositoryProject
        properties:
          repository: ${testRepository.name}
          body: this is a test project
      testProjectColumn:
        type: github:ProjectColumn
        properties:
          projectId: ${testRepositoryProject.id}
      testProjectCard:
        type: github:ProjectCard
        properties:
          columnId: ${testProjectColumn.columnId}
          contentId: ${testIssue.issueId}
          contentType: Issue
    

    Create ProjectCard Resource

    new ProjectCard(name: string, args: ProjectCardArgs, opts?: CustomResourceOptions);
    @overload
    def ProjectCard(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    column_id: Optional[str] = None,
                    content_id: Optional[int] = None,
                    content_type: Optional[str] = None,
                    note: Optional[str] = None)
    @overload
    def ProjectCard(resource_name: str,
                    args: ProjectCardArgs,
                    opts: Optional[ResourceOptions] = None)
    func NewProjectCard(ctx *Context, name string, args ProjectCardArgs, opts ...ResourceOption) (*ProjectCard, error)
    public ProjectCard(string name, ProjectCardArgs args, CustomResourceOptions? opts = null)
    public ProjectCard(String name, ProjectCardArgs args)
    public ProjectCard(String name, ProjectCardArgs args, CustomResourceOptions options)
    
    type: github:ProjectCard
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args ProjectCardArgs
    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 ProjectCardArgs
    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 ProjectCardArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ProjectCardArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ProjectCardArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    ColumnId string
    The ID of the card.
    ContentId int
    github_issue.issue_id.
    ContentType string

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    Note string
    The note contents of the card. Markdown supported.
    ColumnId string
    The ID of the card.
    ContentId int
    github_issue.issue_id.
    ContentType string

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    Note string
    The note contents of the card. Markdown supported.
    columnId String
    The ID of the card.
    contentId Integer
    github_issue.issue_id.
    contentType String

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    note String
    The note contents of the card. Markdown supported.
    columnId string
    The ID of the card.
    contentId number
    github_issue.issue_id.
    contentType string

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    note string
    The note contents of the card. Markdown supported.
    column_id str
    The ID of the card.
    content_id int
    github_issue.issue_id.
    content_type str

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    note str
    The note contents of the card. Markdown supported.
    columnId String
    The ID of the card.
    contentId Number
    github_issue.issue_id.
    contentType String

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    note String
    The note contents of the card. Markdown supported.

    Outputs

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

    CardId int
    The ID of the card.
    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    CardId int
    The ID of the card.
    Etag string
    Id string
    The provider-assigned unique ID for this managed resource.
    cardId Integer
    The ID of the card.
    etag String
    id String
    The provider-assigned unique ID for this managed resource.
    cardId number
    The ID of the card.
    etag string
    id string
    The provider-assigned unique ID for this managed resource.
    card_id int
    The ID of the card.
    etag str
    id str
    The provider-assigned unique ID for this managed resource.
    cardId Number
    The ID of the card.
    etag String
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ProjectCard Resource

    Get an existing ProjectCard 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?: ProjectCardState, opts?: CustomResourceOptions): ProjectCard
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            card_id: Optional[int] = None,
            column_id: Optional[str] = None,
            content_id: Optional[int] = None,
            content_type: Optional[str] = None,
            etag: Optional[str] = None,
            note: Optional[str] = None) -> ProjectCard
    func GetProjectCard(ctx *Context, name string, id IDInput, state *ProjectCardState, opts ...ResourceOption) (*ProjectCard, error)
    public static ProjectCard Get(string name, Input<string> id, ProjectCardState? state, CustomResourceOptions? opts = null)
    public static ProjectCard get(String name, Output<String> id, ProjectCardState 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:
    CardId int
    The ID of the card.
    ColumnId string
    The ID of the card.
    ContentId int
    github_issue.issue_id.
    ContentType string

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    Etag string
    Note string
    The note contents of the card. Markdown supported.
    CardId int
    The ID of the card.
    ColumnId string
    The ID of the card.
    ContentId int
    github_issue.issue_id.
    ContentType string

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    Etag string
    Note string
    The note contents of the card. Markdown supported.
    cardId Integer
    The ID of the card.
    columnId String
    The ID of the card.
    contentId Integer
    github_issue.issue_id.
    contentType String

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    etag String
    note String
    The note contents of the card. Markdown supported.
    cardId number
    The ID of the card.
    columnId string
    The ID of the card.
    contentId number
    github_issue.issue_id.
    contentType string

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    etag string
    note string
    The note contents of the card. Markdown supported.
    card_id int
    The ID of the card.
    column_id str
    The ID of the card.
    content_id int
    github_issue.issue_id.
    content_type str

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    etag str
    note str
    The note contents of the card. Markdown supported.
    cardId Number
    The ID of the card.
    columnId String
    The ID of the card.
    contentId Number
    github_issue.issue_id.
    contentType String

    Must be either Issue or PullRequest

    Remarks: You must either set the note attribute or both content_id and content_type. See note example or issue example for more information.

    etag String
    note String
    The note contents of the card. Markdown supported.

    Import

    A GitHub Project Card can be imported using its Card ID:

    $ pulumi import github:index/projectCard:ProjectCard card 01234567
    

    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