github.com/thiagoyeds/go-cloud@v0.26.0/internal/admin/repository/main.tf (about) 1 # Copyright 2018 The Go Cloud Development Kit Authors 2 # 3 # Licensed under the Apache License, Version 2.0 (the "License"); 4 # you may not use this file except in compliance with the License. 5 # You may obtain a copy of the License at 6 # 7 # https://www.apache.org/licenses/LICENSE-2.0 8 # 9 # Unless required by applicable law or agreed to in writing, software 10 # distributed under the License is distributed on an "AS IS" BASIS, 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 # See the License for the specific language governing permissions and 13 # limitations under the License. 14 15 resource "github_repository" "repo" { 16 name = "${var.name}" 17 description = "${var.description}" 18 homepage_url = "${var.homepage_url}" 19 topics = "${var.topics}" 20 21 has_downloads = true 22 has_issues = true 23 has_projects = false 24 has_wiki = false 25 26 default_branch = "master" 27 allow_merge_commit = false 28 allow_squash_merge = true 29 allow_rebase_merge = false 30 } 31 32 resource "github_branch_protection" "default_branch" { 33 repository = "${github_repository.repo.name}" 34 branch = "${github_repository.repo.default_branch}" 35 enforce_admins = true 36 37 required_status_checks { 38 strict = false 39 40 contexts = [ 41 "cla/google", 42 ] 43 } 44 45 required_pull_request_reviews {} 46 } 47 48 # Permissions 49 50 data "github_team" "eng" { 51 slug = "go-cloud-eng" 52 } 53 54 resource "github_team_repository" "eng" { 55 team_id = "${data.github_team.eng.id}" 56 repository = "${github_repository.repo.name}" 57 permission = "admin" 58 } 59 60 data "github_team" "devrel" { 61 slug = "go-devrel" 62 } 63 64 resource "github_team_repository" "devrel" { 65 team_id = "${data.github_team.devrel.id}" 66 repository = "${github_repository.repo.name}" 67 permission = "push" 68 } 69 70 resource "github_repository_collaborator" "sameer" { 71 repository = "${github_repository.repo.name}" 72 username = "Sajmani" 73 permission = "admin" 74 } 75 76 resource "github_repository_collaborator" "rsc" { 77 repository = "${github_repository.repo.name}" 78 username = "rsc" 79 permission = "push" 80 } 81 82 # Labels 83 84 resource "github_issue_label" "blocked" { 85 repository = "${github_repository.repo.name}" 86 name = "blocked" 87 color = "e89884" 88 description = "Blocked on a different issue" 89 } 90 91 resource "github_issue_label" "bug" { 92 repository = "${github_repository.repo.name}" 93 name = "bug" 94 color = "d73a4a" 95 description = "Something isn't working" 96 } 97 98 resource "github_issue_label" "cla_no" { 99 repository = "${github_repository.repo.name}" 100 name = "cla: no" 101 color = "b60205" 102 description = "Cannot accept contribution until Google CLA is signed." 103 } 104 105 resource "github_issue_label" "cla_yes" { 106 repository = "${github_repository.repo.name}" 107 name = "cla: yes" 108 color = "0e8a16" 109 description = "Google CLA has been signed!" 110 } 111 112 resource "github_issue_label" "code_health" { 113 repository = "${github_repository.repo.name}" 114 name = "code health" 115 color = "bfd4f2" 116 description = "Code health task, either refactoring or testing" 117 } 118 119 resource "github_issue_label" "documentation" { 120 repository = "${github_repository.repo.name}" 121 name = "documentation" 122 color = "edd782" 123 description = "Documentation change" 124 } 125 126 resource "github_issue_label" "duplicate" { 127 repository = "${github_repository.repo.name}" 128 name = "duplicate" 129 color = "cfd3d7" 130 description = "This issue or pull request already exists" 131 } 132 133 resource "github_issue_label" "enhancement" { 134 repository = "${github_repository.repo.name}" 135 name = "enhancement" 136 color = "a2eeef" 137 description = "New feature or request" 138 } 139 140 # The "good first issue" label is treated specially by GitHub: 141 # https://help.github.com/en/articles/helping-new-contributors-find-your-project-with-labels 142 resource "github_issue_label" "good_first_issue" { 143 repository = "${github_repository.repo.name}" 144 name = "good first issue" 145 color = "7057ff" 146 description = "Good for newcomers" 147 } 148 149 resource "github_issue_label" "process" { 150 repository = "${github_repository.repo.name}" 151 name = "process" 152 color = "a2aaef" 153 description = "Improvement to the engineering process" 154 } 155 156 resource "github_issue_label" "in_progress" { 157 repository = "${github_repository.repo.name}" 158 name = "in progress" 159 color = "99ffad" 160 description = "This is being actively worked on" 161 } 162 163 resource "github_issue_label" "needs_info" { 164 repository = "${github_repository.repo.name}" 165 name = "needs info" 166 color = "d876e3" 167 description = "Further discussion or clarification is necessary" 168 } 169 170 resource "github_issue_label" "ready_to_submit" { 171 repository = "${github_repository.repo.name}" 172 name = "ready to submit" 173 color = "0e8a16" 174 description = "Pull request has been approved and should be merged once tests pass" 175 } 176 177 resource "github_issue_label" "P0" { 178 repository = "${github_repository.repo.name}" 179 name = "P0" 180 color = "990000" 181 } 182 183 resource "github_issue_label" "P1" { 184 repository = "${github_repository.repo.name}" 185 name = "P1" 186 color = "ff6666" 187 } 188 189 resource "github_issue_label" "P2" { 190 repository = "${github_repository.repo.name}" 191 name = "P2" 192 color = "cc9900" 193 }