Skip to content

Issue

Source: src/GitHub/Issue.ts

A GitHub repository issue.

Issue manages the lifecycle of a single issue in a repository. Issues are created on the first deploy and updated in place on subsequent deploys when properties change. By default, issues are retained on destruction to preserve discussion history. Pipe the resource through destroy() to close the issue on destruction instead; its discussion remains on GitHub.

Authentication is resolved via the GitHubCredentials service supplied by GitHub.providers() (env, stored PAT, gh CLI, or OAuth). The token needs repo scope for private repositories or public_repo for public ones.

Create a Basic Issue

const issue = yield* GitHub.Issue("bug-report", {
owner: "my-org",
repository: "my-repo",
title: "Bug: Application crashes on startup",
body: "## Description\n\nThe application crashes when...",
})

Issue with Labels and Assignees

const issue = yield* GitHub.Issue("feature-request", {
owner: "my-org",
repository: "my-repo",
title: "Feature: Add dark mode",
body: "Users have requested...",
labels: ["enhancement", "ui"],
assignees: ["developer1"],
})

Deploy with the same logical ID and different properties to update the existing issue in place rather than creating a new one.

const issue = yield* GitHub.Issue("resolved-bug", {
owner: "my-org",
repository: "my-repo",
title: "Bug: Application crashes on startup",
body: "This has been resolved.",
state: "closed",
})
const issue = yield* GitHub.Issue("v1-task", {
owner: "my-org",
repository: "my-repo",
title: "Implement authentication",
milestone: 1,
})

A common pattern is creating issues to track infrastructure changes or deployment status.

yield* GitHub.Issue("infra-status", {
owner: "my-org",
repository: "my-repo",
title: "Infrastructure Status",
body: Output.interpolate`
## Current Status
**Database:** ${database.endpoint}
**Cache:** ${cache.endpoint}
`,
labels: ["infrastructure"],
})