Skip to content

Instantly share code, notes, and snippets.

@gregkare
Created May 28, 2019 09:00
Show Gist options
  • Save gregkare/e35002074355c348263caa8810b37d43 to your computer and use it in GitHub Desktop.
Save gregkare/e35002074355c348263caa8810b37d43 to your computer and use it in GitHub Desktop.
Create labels for repositories in a GitHub org
# Run `terraform init` to install the GitHub provider
# Configure the GitHub Provider
# Generate a Personal access token on https://github.com/settings/tokens with
# full control over private repositories (repo scope).
# When you run Terraform # it will ask for your token, you can also export it in
# your shell:
# $ export TF_VAR_github_token=YOUR_TOKEN
variable "github_token" {}
provider "github" {
token = "${var.github_token}"
organization = "sockethub"
}
# sockethub
resource "github_issue_label" "sockethub_kredits_1" {
repository = "sockethub"
name = "kredits-1"
description = "Small contribution"
color = "008080"
}
resource "github_issue_label" "sockethub_kredits_2" {
repository = "sockethub"
name = "kredits-2"
description = "Medium contribution"
color = "008080"
}
resource "github_issue_label" "sockethub_kredits_3" {
repository = "sockethub"
name = "kredits-3"
description = "Large contribution"
color = "008080"
}
# sockethub-platform-irc
resource "github_issue_label" "sockethub_platform_irc_kredits_1" {
repository = "sockethub-platform-irc"
name = "kredits-1"
description = "Small contribution"
color = "008080"
}
resource "github_issue_label" "sockethub_platform_irc_kredits_2" {
repository = "sockethub-platform-irc"
name = "kredits-2"
description = "Medium contribution"
color = "008080"
}
resource "github_issue_label" "sockethub_platform_irc_kredits_3" {
repository = "sockethub-platform-irc"
name = "kredits-3"
description = "Large contribution"
color = "008080"
}
# sockethub-platform-xmpp
resource "github_issue_label" "sockethub_platform_xmpp_kredits_1" {
repository = "sockethub-platform-xmpp"
name = "kredits-1"
description = "Small contribution"
color = "008080"
}
resource "github_issue_label" "sockethub_platform_xmpp_kredits_2" {
repository = "sockethub-platform-xmpp"
name = "kredits-2"
description = "Medium contribution"
color = "008080"
}
resource "github_issue_label" "sockethub_platform_xmpp_kredits_3" {
repository = "sockethub-platform-xmpp"
name = "kredits-3"
description = "Large contribution"
color = "008080"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment