akur8-oss / terraform-github-repository

Terraform Module for managing Github Repositories and default settings.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

terraform-github-repository

This module is used to create Github repositories with default settings.

Usage

Use the module

module "repo" {
  source = "./"

  name = "my-repo"
}

Requirements

Name Version
terraform ~> 1.0
github ~> 4.0

Providers

Name Version
github ~> 4.0

Resources

Name Type
github_branch.default resource
github_branch_default.this resource
github_repository.this resource
github_team.maintain resource
github_team.read resource
github_team.write resource
github_team_repository.maintain resource
github_team_repository.read resource
github_team_repository.write resource
github_team.maintain data source
github_team.read data source
github_team.write data source

Inputs

Name Description Type Default Required
name (Required) The name of the repository. string n/a yes
allow_auto_merge Set to true to allow auto-merging pull requests on the repository. bool false no
allow_merge_commit Set to true to enable merge commits on the repository. bool false no
allow_rebase_merge Set to true to disable rebase merges on the repository. bool false no
allow_squash_merge Set to false to disable squash merges on the repository. bool true no
archive_on_destroy Set to false to delete the repository instead of archiving on destroy. bool true no
archived Specifies if the repository should be archived. Defaults to false. NOTE Currently, the API does not support unarchiving. bool false no
auto_init Set to false to prevent producing an initial commit in the repository. bool true no
default_branch The name of the repository branch. string "main" no
delete_branch_on_merge Automatically delete head branch after a pull request is merged. Defaults to true. bool true no
description A description of the repository. string null no
gitignore_template Use the name of the template without the extension. For example, Haskell. 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 URL of a page describing the project. string null no
is_template Set to true to tell GitHub that this is a template repository. bool false no
license_template Use the name of the template without the extension. For example, mit or mpl-2.0. string null no
teams_maintain Slugs of the teams that will be granted the 'maintain' privilege. If null, a team will be created. list(string) [] no
teams_read Slugs of the teams that will be granted the 'pull' privilege. If null, a team will be created. list(string) [] no
teams_write Slugs of the teams that will be granted the 'write' privilege. If null, a team will be created. list(string) [] no
template Name of the template to use to create the repository (formed as 'owner/repository'). string null no
topics The list of topics of the repository. list(string) [] no
visibility Can be public or private. If your organization is associated with an enterprise account using GitHub Enterprise Cloud or GitHub Enterprise Server 2.20+, visibility can also be internal. The visibility parameter overrides the private parameter. string "private" no
vulnerability_alerts Set to true to enable security alerts for vulnerable dependencies. Enabling requires alerts to be enabled on the owner level. (Note for importing: GitHub enables the alerts on public repos but disables them on private repos by default.) See GitHub Documentation for details. Note that vulnerability alerts have not been successfully tested on any GitHub Enterprise instance and may be unavailable in those settings. bool true no

Outputs

Name Description
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.
ssh_clone_url URL that can be provided to git clone to clone the repository via SSH.

About

Terraform Module for managing Github Repositories and default settings.

License:MIT License


Languages

Language:HCL 100.0%