Giter VIP home page Giter VIP logo

terraform-github-repository's Introduction

GitHub Repository

Create a new repository.

Example Usage

Create public (e.g. open source) repository

module "repository" {
  source = "innovationnorway/repository/github"

  name = "example"

  description = "My example codebase"

  private = false

  gitignore_template = "Node"
  license_template   = "mit"

  topics = ["example"]
}

Add collaborators and teams

module "repository" {
  source = "innovationnorway/repository/github"

  name = "example"

  description = "My example codebase"

  collaborators = [
    {
      username   = "joakimhellum-in"
      permission = "push"
    },
    {
      username   = "innovationnorway-bot"
      permission = "pull"
    },
  ]

  teams = [
    {
      name       = "terraform"
      permission = "push"
    },
    {
      name       = "security"
      permission = "pull"
    },
  ]
}

Add deploy keys

module "repository" {
  source = "innovationnorway/repository/github"

  name = "example"

  description = "My example codebase"

  deploy_keys = [
    {
      title = "example-key"
      key   = "ssh-rsa AAAAB3NzaC1yc2EAAA..."

      read_only = true
    },
  ]
}

Arguments

Name Type Description
name string Required. The name of the repository.
description string A short description of the repository.
homepage_url string A URL with more information about the repository.
private bool Either true to create a private repository or false to create a public one. Creating private repositories requires a paid GitHub account. Default: true.
has_issues bool Either true to enable issues for the repository or false to disable them. Default: true.
has_projects bool Either true to enable projects for the repository or false to disable them. Default: false.
has_wiki bool Either true to enable the wiki for the repository or false to disable it. Default: false.
auto_init bool Pass true to create an initial commit with empty README.md. Default: false.
gitignore_template string Desired language or platform .gitignore template to apply. Use the name of the template without the extension. For example: Terraform or VisualStudio.
license_template string Choose an open source license template that best suits your needs, and then use the license keyword as the license_template string. For example: mit or mpl-2.0.
allow_squash_merge bool Either true to allow squash-merging pull requests, or false to prevent squash-merging. Default: true.
allow_merge_commit bool Either true to allow merging pull requests with a merge commit, or false to prevent merging pull requests with merge commits. Default: true.
allow_rebase_merge bool Either true to allow rebase-merging pull requests, or false to prevent rebase-merging. Default: true.
archived bool Pass true to archive the repository. Note: You cannot unarchive repositories through the API. Default: false.
topics list A list of topics to add to the repository. Pass one or more topics to replace the set of existing topics. Send an empty list ([]) to clear all topics from the repository.
default_branch string Updates the default branch for the repository. Note: This can only be set after a repository has been created, and after a correct reference has been created for the target branch inside the repository.
collaborators list Add users as collaborators on the repository.
teams list Add the repository to a team or update teams permission on the repository.
deploy_keys list Add deploy keys (SSH keys) that grants access to the repository.

The collaborators object must have the following keys:

Name Type Description
username string The user to add to the repository as a collaborator.
permission string The permission to grant the collaborator. Can be one of:
* pull - can pull, but not push to or administer this repository.
* push - can pull and push, but not administer this repository.
* admin - can pull, push and administer this repository.

The teams object must have the following keys:

Name Type Description
name string The slug of a team to be granted access on the repository.
permission string The permission to grant the team on this repository. Can be one of:
* pull - team members can pull, but not push to or administer this repository.
* push - team members can pull and push, but not administer this repository.
* admin - team members can pull, push and administer this repository.

The deploy_keys object must have the following keys:

Name Type Description
title string A name for the key.
key string The contents of the key.
read_only bool Deploy keys with write access can perform the same actions as an organization member with admin access, or a collaborator on a personal repository. Default: true.

Limitations

Due to current limitations of the Terraform language, items added or removed from the collaborators, teams and deploy_keys lists, will also update subsequent items with indexes greater than where the addition or removal was made.

terraform-github-repository's People

Contributors

semantic-release-bot avatar

Watchers

 avatar

terraform-github-repository's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.