terraform-provider-githubfile

command module
v1.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 11, 2026 License: Apache-2.0 Imports: 3 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

terraform-provider-githubfile

Build status

A Terraform provider for managing files in GitHub repositories.

Use-cases

A few possible use-cases for terraform-provider-githubfile are:

  • Adding a LICENSE file to a number of repositories.
  • Making sure repositories across an organisation have consistent issue/pull request templates.
  • Configuring a tool such as golangci-lint or pre-commit uniformly across a number of repositories

Installation

Download the relevant binary from releases and copy it to $HOME/.terraform.d/plugins/.

Configuration

The following provider block variables are available for configuration:

Name Description
commit_message_prefix An optional prefix to be added to all commits generated as a result of manipulating files.
github_email The email address to use for commit messages.
If a GPG key is provided, this must match the one which the key corresponds to.
github_token A GitHub authorisation token with repo permissions and having admin access to the target repositories.
github_username The username to use for commit messages.
gpg_passphrase The passphrase associated with the provided gpg_secret_key (see below).
gpg_secret_key The GPG secret key to be use for commit signing.
If left empty, commits will not be signed.

Alternatively, these values can be read from environment variables.

Resources

githubfile_file

The githubfile_file resource represents a file in a given branch of a GitHub repository.

Attributes
Name Description
repository_owner The owner of the repository.
repository_name The name of the repository.
branch The branch in which to create/update the file
Leaving this empty will cause the file to be created/updated in the default branch.
path The path to the file being created/updated.
contents The contents of the file.
Example
resource "githubfile_file" "form3tech_oss_terraform_provider_githubfile_issue_template" {
    repository_owner            = "form3tech-oss"
    repository_name             = "terraform-provider-githubfile"
    branch                      = ""
    path                        = ".github/ISSUE_TEMPLATE.md"
    contents                    = <<EOF
# Issue Type

- [ ] Bug report.
- [ ] Suggestion.

# Description

<!-- Please provide a description of the issue. -->
EOF
}

Creating the resource above will result in the .github/ISSUE_TEMPLATE.md file being created/updated on the default branch of the form3tech-oss/terraform-provider-githubfile repository with the following contents:

# Issue Type

- [ ] Bug report.
- [ ] Suggestion.

# Description

<!-- Please provide a description of the issue. -->

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL