Project Card Args
data class ProjectCardArgs(val columnId: Output<String>? = null, val contentId: Output<Int>? = null, val contentType: Output<String>? = null, val note: Output<String>? = null) : ConvertibleToJava<ProjectCardArgs>
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", {
name: "An Organization Project",
body: "This is an organization project.",
});
const column = new github.ProjectColumn("column", {
projectId: project.id,
name: "Backlog",
});
const card = new github.ProjectCard("card", {
columnId: column.columnId,
note: "## Unaccepted 👇",
});
Content copied to clipboard
import pulumi
import pulumi_github as github
project = github.OrganizationProject("project",
name="An Organization Project",
body="This is an organization project.")
column = github.ProjectColumn("column",
project_id=project.id,
name="Backlog")
card = github.ProjectCard("card",
column_id=column.column_id,
note="## Unaccepted 👇")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var project = new Github.OrganizationProject("project", new()
{
Name = "An Organization Project",
Body = "This is an organization project.",
});
var column = new Github.ProjectColumn("column", new()
{
ProjectId = project.Id,
Name = "Backlog",
});
var card = new Github.ProjectCard("card", new()
{
ColumnId = column.ColumnId,
Note = "## Unaccepted 👇",
});
});
Content copied to clipboard
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{
Name: pulumi.String("An Organization Project"),
Body: pulumi.String("This is an organization project."),
})
if err != nil {
return err
}
column, err := github.NewProjectColumn(ctx, "column", &github.ProjectColumnArgs{
ProjectId: project.ID(),
Name: pulumi.String("Backlog"),
})
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
})
}
Content copied to clipboard
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()
.name("An Organization Project")
.body("This is an organization project.")
.build());
var column = new ProjectColumn("column", ProjectColumnArgs.builder()
.projectId(project.id())
.name("Backlog")
.build());
var card = new ProjectCard("card", ProjectCardArgs.builder()
.columnId(column.columnId())
.note("## Unaccepted 👇")
.build());
}
}
Content copied to clipboard
resources:
project:
type: github:OrganizationProject
properties:
name: An Organization Project
body: This is an organization project.
column:
type: github:ProjectColumn
properties:
projectId: ${project.id}
name: Backlog
card:
type: github:ProjectCard
properties:
columnId: ${column.columnId}
note: "## Unaccepted \U0001F447"
Content copied to clipboard
Adding An Issue To A Project
import * as pulumi from "@pulumi/pulumi";
import * as github from "@pulumi/github";
const test = new github.Repository("test", {
name: "myrepo",
hasProjects: true,
hasIssues: true,
});
const testIssue = new github.Issue("test", {
repository: test.id,
title: "Test issue title",
body: "Test issue body",
});
const testRepositoryProject = new github.RepositoryProject("test", {
name: "test",
repository: test.name,
body: "this is a test project",
});
const testProjectColumn = new github.ProjectColumn("test", {
projectId: testRepositoryProject.id,
name: "Backlog",
});
const testProjectCard = new github.ProjectCard("test", {
columnId: testProjectColumn.columnId,
contentId: testIssue.issueId,
contentType: "Issue",
});
Content copied to clipboard
import pulumi
import pulumi_github as github
test = github.Repository("test",
name="myrepo",
has_projects=True,
has_issues=True)
test_issue = github.Issue("test",
repository=test.id,
title="Test issue title",
body="Test issue body")
test_repository_project = github.RepositoryProject("test",
name="test",
repository=test.name,
body="this is a test project")
test_project_column = github.ProjectColumn("test",
project_id=test_repository_project.id,
name="Backlog")
test_project_card = github.ProjectCard("test",
column_id=test_project_column.column_id,
content_id=test_issue.issue_id,
content_type="Issue")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Github = Pulumi.Github;
return await Deployment.RunAsync(() =>
{
var test = new Github.Repository("test", new()
{
Name = "myrepo",
HasProjects = true,
HasIssues = true,
});
var testIssue = new Github.Issue("test", new()
{
Repository = test.Id,
Title = "Test issue title",
Body = "Test issue body",
});
var testRepositoryProject = new Github.RepositoryProject("test", new()
{
Name = "test",
Repository = test.Name,
Body = "this is a test project",
});
var testProjectColumn = new Github.ProjectColumn("test", new()
{
ProjectId = testRepositoryProject.Id,
Name = "Backlog",
});
var testProjectCard = new Github.ProjectCard("test", new()
{
ColumnId = testProjectColumn.ColumnId,
ContentId = testIssue.IssueId,
ContentType = "Issue",
});
});
Content copied to clipboard
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 {
test, err := github.NewRepository(ctx, "test", &github.RepositoryArgs{
Name: pulumi.String("myrepo"),
HasProjects: pulumi.Bool(true),
HasIssues: pulumi.Bool(true),
})
if err != nil {
return err
}
testIssue, err := github.NewIssue(ctx, "test", &github.IssueArgs{
Repository: test.ID(),
Title: pulumi.String("Test issue title"),
Body: pulumi.String("Test issue body"),
})
if err != nil {
return err
}
testRepositoryProject, err := github.NewRepositoryProject(ctx, "test", &github.RepositoryProjectArgs{
Name: pulumi.String("test"),
Repository: test.Name,
Body: pulumi.String("this is a test project"),
})
if err != nil {
return err
}
testProjectColumn, err := github.NewProjectColumn(ctx, "test", &github.ProjectColumnArgs{
ProjectId: testRepositoryProject.ID(),
Name: pulumi.String("Backlog"),
})
if err != nil {
return err
}
_, err = github.NewProjectCard(ctx, "test", &github.ProjectCardArgs{
ColumnId: testProjectColumn.ColumnId,
ContentId: testIssue.IssueId,
ContentType: pulumi.String("Issue"),
})
if err != nil {
return err
}
return nil
})
}
Content copied to clipboard
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 test = new Repository("test", RepositoryArgs.builder()
.name("myrepo")
.hasProjects(true)
.hasIssues(true)
.build());
var testIssue = new Issue("testIssue", IssueArgs.builder()
.repository(test.id())
.title("Test issue title")
.body("Test issue body")
.build());
var testRepositoryProject = new RepositoryProject("testRepositoryProject", RepositoryProjectArgs.builder()
.name("test")
.repository(test.name())
.body("this is a test project")
.build());
var testProjectColumn = new ProjectColumn("testProjectColumn", ProjectColumnArgs.builder()
.projectId(testRepositoryProject.id())
.name("Backlog")
.build());
var testProjectCard = new ProjectCard("testProjectCard", ProjectCardArgs.builder()
.columnId(testProjectColumn.columnId())
.contentId(testIssue.issueId())
.contentType("Issue")
.build());
}
}
Content copied to clipboard
resources:
test:
type: github:Repository
properties:
name: myrepo
hasProjects: true
hasIssues: true
testIssue:
type: github:Issue
name: test
properties:
repository: ${test.id}
title: Test issue title
body: Test issue body
testRepositoryProject:
type: github:RepositoryProject
name: test
properties:
name: test
repository: ${test.name}
body: this is a test project
testProjectColumn:
type: github:ProjectColumn
name: test
properties:
projectId: ${testRepositoryProject.id}
name: Backlog
testProjectCard:
type: github:ProjectCard
name: test
properties:
columnId: ${testProjectColumn.columnId}
contentId: ${testIssue.issueId}
contentType: Issue
Content copied to clipboard
Import
A GitHub Project Card can be imported using its Card ID:
$ pulumi import github:index/projectCard:ProjectCard card 01234567
Content copied to clipboard