On macOS:
- Install Homebrew
- Install GitHub CLI:
brew install gh - Install Terraform:
brew tap hashicorp/tapbrew install hashicorp/tap/terraform
export TF_VAR_GITHUB_TOKEN=<GITHUB_TOKEN>
terraform import "github_repository.terraform-playground" "name-of-github-repository-resource"- Repository:
- Administration: read and write
- Issues: read and write (voor labels)
- Metadata: read only
- Pages: read and write
- Organization:
- Administration: read only
- Members: read and write
You can login in to Terraform on app.terraform.io.
When you configure Terraform Cloud, you must configure use the user interface to configure the sensitive variables
defined in variables.tf.
The following code is responsible for storing the Terraform state in the cloud:
cloud {
organization = "nl-design-system"
workspaces {
name = "github"
}
}
Removing this code should allow you to switch back to storing state in terraform.tfstate.
- provider:
github- data source:
github_organization - data source:
github_user - resource:
github_repository - resource:
github_branch_protection - resource:
github_repository_collaborators - resource:
github_team - resource:
github_team_members
- data source:
- provider:
vercel- resource:
vercel_project
- resource:
Most communities within the NL Design System use a standard structure for their permissions and teams.
An organisation (or repository) usually has three teams: Triage, Committer, Maintainer (also see the Github Documentation on permissions)
organisation-triageorganisation-committerorganisation-maintainer
- Can create issues
- Can label issues
- All triage permissions
- Can push to repository
- Can merge pull requests (if conditions such as approvals are met)
- All committer permissions
- Add users (
⚠️ Note: do not use this permission, always modify users through terraform) - Review pull requests
- Work with the NL Design System Kernteam to add new members
- Create Github Milestones and modify labels
- Add the
github_usertouser.tf. - Add the
github_useras one of themembersto the existing team inteam-members.tf.
- Create the
github_teaminteam.tf. - Create a subteam
github_teaminteam.tf, with people who should be able to make pull requests. Follow the team name pattern:organization-committerororganization-repository-committer. Specifyparent_team_idto extend the organization team. - Create a subteam for maintainers the
github_teaminteam.tf. Follow the team name pattern:organization-maintainer. Specifyparent_team_idto extend the committer team. - Add each user as
github_usertouser.tf. - Add
github_team_membersfor the new team inteam-members.tf, and specify all users as members. Decide which users go into thecommitterteam, and which users are in themaintainerteam. - Add the
organization-maintainerteam to the terraformgithub_repositoryinterraform.tf, so the maintainers are able to make and review Pull Requests.