github.com/cornelk/go-cloud@v0.17.1/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 "Travis CI - Pull Request", 42 "cla/google", 43 ] 44 } 45 46 required_pull_request_reviews {} 47 } 48 49 # Permissions 50 51 data "github_team" "eng" { 52 slug = "go-cloud-eng" 53 } 54 55 resource "github_team_repository" "eng" { 56 team_id = "${data.github_team.eng.id}" 57 repository = "${github_repository.repo.name}" 58 permission = "admin" 59 } 60 61 data "github_team" "devrel" { 62 slug = "go-devrel" 63 } 64 65 resource "github_team_repository" "devrel" { 66 team_id = "${data.github_team.devrel.id}" 67 repository = "${github_repository.repo.name}" 68 permission = "push" 69 } 70 71 resource "github_repository_collaborator" "sameer" { 72 repository = "${github_repository.repo.name}" 73 username = "Sajmani" 74 permission = "admin" 75 } 76 77 resource "github_repository_collaborator" "rsc" { 78 repository = "${github_repository.repo.name}" 79 username = "rsc" 80 permission = "push" 81 } 82 83 # Labels 84 85 resource "github_issue_label" "blocked" { 86 repository = "${github_repository.repo.name}" 87 name = "blocked" 88 color = "e89884" 89 description = "Blocked on a different issue" 90 } 91 92 resource "github_issue_label" "bug" { 93 repository = "${github_repository.repo.name}" 94 name = "bug" 95 color = "d73a4a" 96 description = "Something isn't working" 97 } 98 99 resource "github_issue_label" "cla_no" { 100 repository = "${github_repository.repo.name}" 101 name = "cla: no" 102 color = "b60205" 103 description = "Cannot accept contribution until Google CLA is signed." 104 } 105 106 resource "github_issue_label" "cla_yes" { 107 repository = "${github_repository.repo.name}" 108 name = "cla: yes" 109 color = "0e8a16" 110 description = "Google CLA has been signed!" 111 } 112 113 resource "github_issue_label" "code_health" { 114 repository = "${github_repository.repo.name}" 115 name = "code health" 116 color = "bfd4f2" 117 description = "Code health task, either refactoring or testing" 118 } 119 120 resource "github_issue_label" "documentation" { 121 repository = "${github_repository.repo.name}" 122 name = "documentation" 123 color = "edd782" 124 description = "Documentation change" 125 } 126 127 resource "github_issue_label" "duplicate" { 128 repository = "${github_repository.repo.name}" 129 name = "duplicate" 130 color = "cfd3d7" 131 description = "This issue or pull request already exists" 132 } 133 134 resource "github_issue_label" "enhancement" { 135 repository = "${github_repository.repo.name}" 136 name = "enhancement" 137 color = "a2eeef" 138 description = "New feature or request" 139 } 140 141 # The "good first issue" label is treated specially by GitHub: 142 # https://help.github.com/en/articles/helping-new-contributors-find-your-project-with-labels 143 resource "github_issue_label" "good_first_issue" { 144 repository = "${github_repository.repo.name}" 145 name = "good first issue" 146 color = "7057ff" 147 description = "Good for newcomers" 148 } 149 150 resource "github_issue_label" "process" { 151 repository = "${github_repository.repo.name}" 152 name = "process" 153 color = "a2aaef" 154 description = "Improvement to the engineering process" 155 } 156 157 resource "github_issue_label" "in_progress" { 158 repository = "${github_repository.repo.name}" 159 name = "in progress" 160 color = "99ffad" 161 description = "This is being actively worked on" 162 } 163 164 resource "github_issue_label" "needs_info" { 165 repository = "${github_repository.repo.name}" 166 name = "needs info" 167 color = "d876e3" 168 description = "Further discussion or clarification is necessary" 169 } 170 171 resource "github_issue_label" "ready_to_submit" { 172 repository = "${github_repository.repo.name}" 173 name = "ready to submit" 174 color = "0e8a16" 175 description = "Pull request has been approved and should be merged once tests pass" 176 } 177 178 resource "github_issue_label" "P0" { 179 repository = "${github_repository.repo.name}" 180 name = "P0" 181 color = "990000" 182 } 183 184 resource "github_issue_label" "P1" { 185 repository = "${github_repository.repo.name}" 186 name = "P1" 187 color = "ff6666" 188 } 189 190 resource "github_issue_label" "P2" { 191 repository = "${github_repository.repo.name}" 192 name = "P2" 193 color = "cc9900" 194 }