# Manage repositories

Create repositories through `org/modules/github/repository`. The module applies the private visibility, merge settings, feature settings, Actions access, and destruction protection used by StormTrust.

## Create a repository

1. In `org/github/`, add a module call for the repository.  
```hcl  
module "example_service_repository" {  
  source = "../modules/github/repository"  
  name                 = "example-service"  
  actions_access_level = "none"  
}  
```
2. Run `make fmt` and ` make verify` from the repository root.
3. Follow the [pull request workflow](/stormtrust/engineering/github/pull-request-workflow/). Terraform creates the empty GitHub repository during the post-merge apply.
4. After the apply succeeds, push the first repository commit.

New repositories do not need import blocks. Do not create them first with the GitHub CLI or dashboard.

## Adopt a repository

Declare an existing repository through the same module. Add an import block so Terraform binds the remote repository to its state address.

```hcl
import {
  to = module.example_service_repository.github_repository.this
  id = "example-service"
}
```

Retain the import block as an adoption and state-recovery record. The first plan must not add, replace, or destroy the repository.
