Git Product home page Git Product logo

terraform-github-environments's Introduction

terraform-github-environments

semantic-release terraform-github-environments

Terraform module to create Github Environments for Github Actions.

Usage

Note: Github Actions Environments are available for Public Repositories and Github Enterprise Cloud users. (doc)

Github Authentication

You will need to authenticate against Github using an OAuth Token or Personal Access Token. See Github Provider#Authentication for more informations.

This can be done by setting the token argument of the github provider or by exporting your Token to the GITHUB_TOKEN environment variable.

Provider configuration:

provider "github" {
  token = var.token # or `GITHUB_TOKEN`
}

Environment variable configuration:

export GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Creating the Environments

This module takes a map of objects for each Environement to configure.

module "env" {
  source = "../"

  repository = "tbobm/terraform-github-secrets"

  environments = {
    "stable" = {}

    "protected" = {
      deployment_branch_policy = {
        protected_branches     = true
        custom_branch_policies = false
      }
    }
  }
}

Here we defined two environemnts:

  • the stable environment
  • the protected environment with protected branches enabled

Doc generation

Code formatting and documentation for variables and outputs is generated using pre-commit-terraform hooks which uses terraform-docs.

Follow these instructions to install pre-commit locally.

And install terraform-docs with go get github.com/segmentio/terraform-docs or brew install terraform-docs.

Contributing

Report issues/questions/feature requests on in the issues section.

Full contributing guidelines are covered here.

Requirements

Name Version
github ~> 4.0

Providers

Name Version
github ~> 4.0

Modules

No modules.

Resources

Name Type
github_repository_environment.this resource
github_repository.this data source

Inputs

Name Description Type Default Required
environments A map of environment definitions map(any) n/a yes
repository The full name of the repository in the form org/repo string n/a yes

Outputs

Name Description
environments A map of the created environments
repository The target github repository informations

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.