github_issue

Provides a GitHub issue resource.

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

Example Usage

# Create a simple issue
resource "github_repository" "test" {
  name = "tf-acc-test-%s"
  auto_init  = true
  has_issues = true
}

resource "github_issue" "test" {
  repository       = github_repository.test.name
  title            = "My issue title"
  body             = "The body of my issue"
}

Example Usage with milestone and project assignment

# Create an issue with milestone and project assignment
resource "github_repository" "test" {
  name = "tf-acc-test-%s"
  auto_init  = true
  has_issues = true
}

resource "github_repository_milestone" "test" {
  owner = split("/", "${github_repository.test.full_name}")[0]
  repository = github_repository.test.name
  title = "v1.0.0"
  description = "General Availability"
  due_date = "2022-11-22"
  state = "open"
}

resource "github_issue" "test" {
  repository       = github_repository.test.name
  title            = "My issue"
  body             = "My issue body"
  labels           = ["bug", "documentation"]
  assignees        = ["bob-github"]
  milestone_number = github_repository_milestone.test.number
}

Argument Reference

The following arguments are supported:

Attributes Reference

Import

GitHub Issues can be imported using an ID made up of repository:number, e.g.

$ terraform import github_issue.issue_15 myrepo:15