2022-06-04 15:17:08 +00:00
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "gitea_repository Resource - terraform-provider-gitea"
subcategory: ""
description: |-
2022-06-12 15:49:33 +00:00
gitea_repository manages a gitea repository.
Per default this repository will be initializiled with the provided configuration (gitignore, License etc.).
If the username property is set to a organisation name, the provider will try to look if this organisation exists and create the repository under the organisation scope.
Repository migrations have some properties that are not available to regular repositories. These are all prefixed with migration_.
2023-04-21 11:23:18 +00:00
Codeberg.org does currently not allow mirrors to be created. See FAQ Section of CodeBerg for more information: https://docs.codeberg.org/getting-started/faq/#why-am-i-not-allowed-to-set-up-an-automatic-mirror
2022-06-04 15:17:08 +00:00
---
# gitea_repository (Resource)
2022-06-12 15:49:33 +00:00
`gitea_repository` manages a gitea repository.
2022-06-04 15:17:08 +00:00
2022-06-12 15:49:33 +00:00
Per default this repository will be initializiled with the provided configuration (gitignore, License etc.).
If the `username` property is set to a organisation name, the provider will try to look if this organisation exists and create the repository under the organisation scope.
2022-06-04 15:17:08 +00:00
2022-06-12 15:49:33 +00:00
Repository migrations have some properties that are not available to regular repositories. These are all prefixed with `migration_` .
2023-04-21 11:23:18 +00:00
Codeberg.org does currently not allow mirrors to be created. See FAQ Section of CodeBerg for more information: https://docs.codeberg.org/getting-started/faq/#why-am-i-not-allowed-to-set-up-an-automatic-mirror
2022-06-12 15:49:33 +00:00
## Example Usage
```terraform
resource "gitea_repository" "test" {
username = "lerentis"
name = "test"
private = true
issue_labels = "Default"
license = "MIT"
gitignores = "Go"
}
resource "gitea_repository" "mirror" {
username = "lerentis"
name = "terraform-provider-gitea-mirror"
description = "Mirror of Terraform Provider"
mirror = true
migration_clone_addresse = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git"
migration_service = "gitea"
migration_service_auth_token = var.gitea_mirror_token
}
2023-05-31 01:27:59 +00:00
resource "gitea_repository" "clone" {
username = "lerentis"
name = "terraform-provider-gitea-clone"
description = "Clone of Terraform Provider"
mirror = false
migration_clone_address = "https://git.uploadfilter24.eu/lerentis/terraform-provider-gitea.git"
migration_service = "gitea"
migration_service_auth_token = var.gitea_clone_token
}
2022-06-12 15:49:33 +00:00
```
2022-06-04 15:17:08 +00:00
<!-- schema generated by tfplugindocs -->
## Schema
### Required
2022-06-12 15:49:33 +00:00
- `name` (String) The Name of the repository
- `username` (String) The Owner of the repository
2022-06-04 15:17:08 +00:00
### Optional
- `allow_manual_merge` (Boolean)
- `allow_merge_commits` (Boolean)
- `allow_rebase` (Boolean)
- `allow_rebase_explicit` (Boolean)
- `allow_squash_merge` (Boolean)
- `archived` (Boolean)
2022-06-12 15:49:33 +00:00
- `auto_init` (Boolean) Flag if the repository should be initiated with the configured values
2022-06-04 15:17:08 +00:00
- `autodetect_manual_merge` (Boolean)
2022-06-12 15:49:33 +00:00
- `default_branch` (String) The default branch of the repository. Defaults to `main`
- `description` (String) The description of the repository.
- `gitignores` (String) A specific gitignore that should be commited to the repositoryon creation if `auto_init` is set to `true`
Need to exist in the gitea instance
- `has_issues` (Boolean) A flag if the repository should have issue management enabled or not.
- `has_projects` (Boolean) A flag if the repository should have the native project management enabled or not.
- `has_pull_requests` (Boolean) A flag if the repository should acceppt pull requests or not.
- `has_wiki` (Boolean) A flag if the repository should have the native wiki enabled or not.
2022-06-04 15:17:08 +00:00
- `ignore_whitespace_conflicts` (Boolean)
2022-06-12 15:49:33 +00:00
- `issue_labels` (String) The Issue Label configuration to be used in this repository.
Need to exist in the gitea instance
- `license` (String) The license under which the source code of this repository should be.
Need to exist in the gitea instance
2022-08-14 18:53:18 +00:00
- `migration_clone_address` (String)
- `migration_clone_addresse` (String) DEPRECATED in favor of `migration_clone_address`
2022-06-04 20:43:23 +00:00
- `migration_issue_labels` (Boolean)
- `migration_lfs` (Boolean)
- `migration_lfs_endpoint` (String)
- `migration_milestones` (Boolean)
- `migration_mirror_interval` (String) valid time units are 'h', 'm', 's'. 0 to disable automatic sync
- `migration_releases` (Boolean)
- `migration_service` (String) git/github/gitlab/gitea/gogs
- `migration_service_auth_password` (String, Sensitive)
- `migration_service_auth_token` (String, Sensitive)
- `migration_service_auth_username` (String)
- `mirror` (Boolean)
2022-06-12 15:49:33 +00:00
- `private` (Boolean) Flag if the repository should be private or not.
2022-06-04 15:17:08 +00:00
- `readme` (String)
- `repo_template` (Boolean)
2022-06-12 15:49:33 +00:00
- `website` (String) A link to a website with more information.
2022-06-04 15:17:08 +00:00
### Read-Only
2022-10-29 22:41:45 +00:00
- `clone_url` (String)
2022-12-24 17:04:10 +00:00
- `created` (String)
2022-10-29 22:41:45 +00:00
- `html_url` (String)
2022-06-04 15:17:08 +00:00
- `id` (String) The ID of this resource.
- `permission_admin` (Boolean)
- `permission_pull` (Boolean)
- `permission_push` (Boolean)
2022-12-24 17:04:10 +00:00
- `ssh_url` (String)
2022-06-04 15:17:08 +00:00
- `updated` (String)