github_release

This resource allows you to create and manage a release in a specific GitHub repository.

Example Usage

resource "github_repository" "repo" {
  name         = "repo"
  description  = "GitHub repo managed by Terraform"

  private = false
}

resource "github_release" "example" {
  repository = github_repository.repo.name
  tag_name   = "v1.0.0"
}

Example Usage on Non-Default Branch

resource "github_repository" "example" {
  name      = "repo"
  auto_init = true
}

resource "github_branch" "example" {
  repository    = github_repository.example.name
  branch        = "branch_name"
  source_branch = github_repository.example.default_branch
}

resource "github_release" "example" {
  repository       = github_repository.example.name
  tag_name         = "v1.0.0"
  target_commitish = github_branch.example.branch
  draft            = false
  prerelease       = false
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following additional attributes are exported:

Import

This resource can be imported using the name of the repository, combined with the id of the release, and a : character for separating components, e.g.

$ terraform import github_release.example repo:12345678