A 1 module for creating a public or private repository on 2.
The MIT License (MIT)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Source: <https://opensource.org/licenses/MIT>
See LICENSE for full details.
Name | Version |
---|---|
terraform | >= 0.14 |
github | >= 4.20, < 6.0 |
No modules.
Name | Type |
---|---|
github_actions_secret.repository_secret | resource |
github_app_installation_repository.app_installation_repository | resource |
github_branch.branch | resource |
github_branch_default.default | resource |
github_branch_protection_v3.branch_protection | resource |
github_issue_label.label | resource |
github_repository.repository | resource |
github_repository_autolink_reference.repository_autolink_reference | resource |
github_repository_collaborator.collaborator | resource |
github_repository_deploy_key.deploy_key | resource |
github_repository_deploy_key.deploy_key_computed | resource |
github_repository_project.repository_project | resource |
github_repository_webhook.repository_webhook | resource |
github_team_repository.team_repository | resource |
github_team_repository.team_repository_by_slug | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
admin_collaborators | A list of users to add as collaborators granting them admin full permission. | list(string) |
[] |
no |
admin_team_ids | A list of teams (by id ) to grant admin full permission to. |
list(string) |
[] |
no |
admin_teams | A list of teams (by name /slug ) to grant admin full permission to. |
list(string) |
[] |
no |
allow_auto_merge | Set to true to allow auto-merging pull requests on the repository. If enabled for a pull request, the pull request will mergeautomatically when all required reviews are met and status checks have passed. |
bool |
false |
no |
allow_merge_commit | Set to false to disable merge commits on the repository. | bool |
true |
no |
allow_rebase_merge | Set to true to enable rebase merges on the repository. | bool |
false |
no |
allow_squash_merge | Set to true to enable squash merges on the repository. | bool |
false |
no |
app_installations | (Optional) A list of GitHub App IDs to be installed in this repository. | set(string) |
[] |
no |
archive_on_destroy | Set to false to not archive the repository instead of deleting on destroy. |
string |
true |
no |
archived | (Optional) Specifies if the repository should be archived. (Default: false) | bool |
false |
no |
auto_init | Wether or not to produce an initial commit in the repository. | bool |
true |
no |
autolink_references | Configuring autolink references. For details please check: 7 Example: autolink_references = [ |
list(object({ |
[] |
no |
branch_protections_v3 | A list of branch protections to apply to the repository. We can't use a detailed type specification due to a terraform limitation. However, this might be changed in a future Terraform version. See 8 and 9. type = list(object({Example: branch_protections = [ |
any |
null |
no |
branches | A list of branches to be created in this repository. | any |
[] |
no |
default_branch | The name of the default branch of the repository. NOTE: This can only be set after a repository has already been created, and after acorrect reference has been created for the target branch inside the repository. This means a user will have to omit this parameter from the initial repositorycreation and create the target branch inside of the repository prior to setting this attribute. |
string |
null |
no |
delete_branch_on_merge | Whether or not to delete the merged branch after merging a pull request. | bool |
false |
no |
deploy_keys | Configure a deploy key ( SSH key ) that grants access to a single GitHub repository. This key is attached directly to the repositoryinstead of to a personal user account. |
any |
[] |
no |
deploy_keys_computed | Configure a deploy key ( SSH key ) that grants access to a single GitHub repository. This key is attached directly to the repository instead of to a personal user account. Example: ` |
any |
[] |
no |
description | A description of the repository. | string |
"" |
no |
encrypted_secrets | Configuring encrypted actions secrets. For details please check: 6. Example: encrypted_secrets = { |
map(string) |
{} |
no |
gitignore_template | Use the name of the template without the extension. For example, Haskell , Terraform or Python .Available templates: 3 |
string |
null |
no |
has_downloads | Set to true to enable the deprecated downloads features on the repository. | bool |
false |
no |
has_issues | Set to true to enable the GitHub Issues features on the repository. | bool |
false |
no |
has_projects | Set to true to enable the GitHub Projects features on the repository. Per the github documentation when in an organization that has disabled repository projects it will default to false and will otherwise default to true. If you specify true when it has been disabled it will return an error. |
bool |
false |
no |
has_wiki | Set to true to enable the GitHub Wiki features on the repository. | bool |
false |
no |
homepage_url | The website of the repository. | string |
null |
no |
is_template | Whether or not to tell GitHub that this is a template repository. | bool |
false |
no |
issue_labels | Configure a GitHub issue label resource. Example: issue_labels = [ |
list(object({ |
[] |
no |
issue_labels_create | Specify whether you want to force or suppress the creation of issues labels. | bool |
null |
no |
issue_labels_merge_with_github_labels | Specify if you want to merge and control githubs default set of issue labels. | bool |
null |
no |
license_template | Use the name of the template without the extension. For example, 'mit' or 'mpl-2.0'. Available licences: 4 |
string |
null |
no |
maintain_collaborators | A list of users to add as collaborators granting them maintain permission. | list(string) |
[] |
no |
maintain_team_ids | A list of teams (by id ) to grant maintain permission to. |
list(string) |
[] |
no |
maintain_teams | A list of teams (by name /slug ) to grant maintain permission to. |
list(string) |
[] |
no |
name | The name of the repository. | string |
n/a | yes |
pages | The repository's GitHub Pages configuration. | any |
{} |
no |
plaintext_secrets | Configuring actions secrets. For details please check: 6. Example: plaintext_secrets = { |
map(string) |
{} |
no |
projects | Create and manage projects for GitHub repository. Example: projects = [ |
list(object({ |
[] |
no |
pull_collaborators | A list of users to add as collaborators granting them pull read-only permission. | list(string) |
[] |
no |
pull_team_ids | (Optional) A list of teams (by id ) to grant pull read-only permission to. |
list(string) |
[] |
no |
pull_teams | A list of teams (by name /slug ) to grant pull read-only permission to. |
list(string) |
[] |
no |
push_collaborators | A list of users to add as collaborators granting them push read-write permission. | list(string) |
[] |
no |
push_team_ids | A list of teams (by id ) to grant push read-write permission to. |
list(string) |
[] |
no |
push_teams | A list of teams (by name /slug ) to grant push read-write permission to. |
list(string) |
[] |
no |
template | Template repository to use. | object({ |
null |
no |
topics | The list of topics of the repository. | list(string) |
[] |
no |
triage_collaborators | A list of users to add as collaborators granting them triage permission. | list(string) |
[] |
no |
triage_team_ids | A list of teams (by id ) to grant triage permission to. |
list(string) |
[] |
no |
triage_teams | A list of teams (by name /slug ) to grant triage permission to. |
list(string) |
[] |
no |
visibility | Can be public , private or internal (GH Enterprise only). The visibility parameter overrides the private parameter.Defaults to private if neither private nor visibility are set, default to state of private parameter if it is set. |
string |
"private" |
no |
vulnerability_alerts | Set to false to disable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. |
bool |
null |
no |
webhooks | Configuring webhooks. For details please check: 5. We can't use a detailed type specification due to a terraform limitation. However, this might be changed in a future Terraform version. See 8 and 9 type = list(object({Example: webhooks = [{ |
any |
[] |
no |
Name | Description |
---|---|
app_installations | A map of deploy app installations keyed by installation id. |
branches | A map of branch objects keyed by branch name. |
collaborators | A map of collaborator objects keyed by collaborator.name. |
deploy_keys | A map of deploy keys keyed by input id. |
full_name | A string of the form 'orgname/reponame'. |
git_clone_url | URL that can be provided to git clone to clone the repository anonymously via the git protocol. |
html_url | URL to the repository on the web. |
http_clone_url | URL that can be provided to git clone to clone the repository via HTTPS. |
issue_labels | A map of issue labels keyed by label input id or name. |
projects | A map of projects keyed by project input id. |
repository | All attributes and arguments as returned by the github_repository resource. |
secrets | List of secrets available. |
ssh_clone_url | URL that can be provided to git clone to clone the repository via SSH. |
webhooks | All attributes and arguments as returned by the github_repository_webhook resource. |
# complete example - main.tf