Terraform module to create GitHub repository and relevant resources.
Name | Version |
---|---|
terraform | ~> 1.0 |
github | ~> 6.2 |
Name | Version |
---|---|
github | 6.2.1 |
Name | Source | Version |
---|---|---|
actions | ./modules/actions | n/a |
rulesets | ./modules/rulesets | n/a |
secrets_and_variables | ./modules/secrets-and-variables | n/a |
Name | Type |
---|---|
github_branch.this | resource |
github_branch_default.this | resource |
github_branch_protection.this | resource |
github_issue_label.this | resource |
github_issue_labels.this | resource |
github_repository.this | resource |
github_repository_autolink_reference.this | resource |
github_repository_collaborator.this | resource |
github_repository_collaborators.this | resource |
github_repository_dependabot_security_updates.this | resource |
github_repository_file.this | resource |
github_repository_tag_protection.this | resource |
github_repository_webhook.this | resource |
Name | Description | Type | Default | Required |
---|---|---|---|---|
actions_repository_access_level | Where the actions or reusable workflows of the repository may be used. Possible values are "none" , "user" , "organization" , or "enterprise" .If null , skip creation of github_actions_repository_access_level resource. |
string |
null |
no |
actions_repository_permissions | GitHub Actions permissions for a given repository. | object({ |
null |
no |
allow_auto_merge | Set to true to allow auto-merging pull requests on the repository. |
bool |
false |
no |
allow_merge_commit | Set to false to disable merge commits on the repository. |
bool |
true |
no |
allow_rebase_merge | Set to false to disable rebase merges on the repository. |
bool |
true |
no |
allow_squash_merge | Set to false to disable squash merges on the repository. |
bool |
true |
no |
allow_update_branch | Set to true to always suggest updating pull request branches. |
bool |
null |
no |
archive_on_destroy | Set to true to archive the repository instead of deleting on destroy. |
bool |
true |
no |
archived | Specifies if the repository should be archived. NOTE Currently, the API does not support unarchiving. |
bool |
false |
no |
auto_init | Set to true to produce an initial commit in the repository. |
bool |
null |
no |
autolink_references | Autolink references. | list(object({ |
[] |
no |
branch_protections | Branch protection rules. | list(object({ |
[] |
no |
branches | Map of branch name and configuration to create. | map(object({ |
{} |
no |
collaborators | List of collaboratos. | object({ |
{} |
no |
collaborators_authoritative | Whether collaborators should be managed in authoritative way. If set true , github_repository_collaborators resource will be used. |
bool |
false |
no |
create | Whether to create this module or not. | bool |
true |
no |
default_branch | The name of the default branch of the repository. | string |
"main" |
no |
default_branch_rename | Indicate if it should rename the branch rather than use an existing branch. | bool |
false |
no |
delete_branch_on_merge | Automatically delete head branch after a pull request is merged. | bool |
false |
no |
dependabot_security_updates_enabled | Whether to enable Dependabot security updates. | bool |
false |
no |
deploy_keys | Deploy keys. | list(object({ |
[] |
no |
deployment_branch_policies | Deployment branch policies. | list(object({ |
[] |
no |
description | A description of the repository. | string |
null |
no |
environments | List of GitHub repository environments. | map(object({ |
{} |
no |
files | Repository files. | list(object({ |
[] |
no |
gitignore_template | Use the name of the template without the extension. For example, "Haskell" . |
string |
null |
no |
has_discussions | Set to true to enable GitHub Discussions on the repository. |
bool |
false |
no |
has_downloads | Set to true to enable the (deprecated) downloads features on the repository. |
bool |
null |
no |
has_issues | Set to true to enable the GitHub Issues features on the repository. |
bool |
true |
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 |
ignore_vulnerability_alerts_during_read | Set to true to not call the vulnerability alerts endpoint so the resource can also be used without admin permissions during read. |
bool |
null |
no |
is_template | Set to true to tell GitHub that this is a template repository. |
bool |
false |
no |
issue_labels | Issue labels. Starting prefix "#" in color will be ignored. |
list(object({ |
[] |
no |
issue_labels_authoritative | Whether issue labels managed in authoritative ways. If true , issue labels will be created using github_issue_labels resource type, possibly causing all the labels not listed removed. |
bool |
false |
no |
license_template | Use the name of the template without the extension. For example, "mit" or "mpl-2.0" . |
string |
null |
no |
merge_commit_message | Can be "PR_BODY" , "PR_TITLE" , or "BLANK" for a default merge commit message. Applicable only if allow_merge_commit is true . |
string |
null |
no |
merge_commit_title | Can be "PR_TITLE" or "MERGE_MESSAGE" for a default merge commit title. Applicable only if allow_merge_commit is true . |
string |
null |
no |
name | The name of the repository. | string |
n/a | yes |
pages | The repository's GitHub Pages configuration. See GitHub Pages Configuration for details. |
object({ |
null |
no |
rulesets | Repository rulesets. | list(object({ |
[] |
no |
secrets | GitHub Actions secrets for this repository. - Available values for subject are "actions" , "codespaces" , "dependabot" .- github_actions_environment_secret resource will be created if environment key specified. |
list(object({ |
[] |
no |
security_and_analysis | The repository's security and analysis configuration. See Security and Analysis Configuration for details. |
object({ |
null |
no |
squash_merge_commit_message | Can be "PR_BODY" , "COMMIT_MESSAGES" , or "BLANK" for a default squash merge commit message. Applicable only if allow_squash_merge is true . |
string |
null |
no |
squash_merge_commit_title | Can be "PR_TITLE" or "COMMIT_OR_PR_TITLE" for a default squash merge commit title. Applicable only if allow_squash_merge is true . |
string |
null |
no |
tag_protections | Tag protection rules. | list(string) |
[] |
no |
template | Use a template repository to create this resource. See Template Repositories for details. |
object({ |
null |
no |
topics | The list of topics of the repository. NOTE: This attribute is not compatible with the github_repository_topics resource. Use one of them.github_repository_topics is only meant to be used if the repository itself is not handled via terraform, for example if it's only read as a datasource (see issue #1845). |
set(string) |
null |
no |
variables | GitHub Actions variables for this repository. Create github_actions_environment_variable resource if environment key specified. |
list(object({ |
[] |
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 |
web_commit_signoff_required | Require contributors to sign off on web-based commits. See more here. | bool |
false |
no |
webhooks | List of webhooks. | list(object({ |
[] |
no |
Name | Description |
---|---|
actions | GitHub Actions module outputs. |
autolink_references | Autolink references. |
branch_default | Default branch name. |
branch_protections | Branch protection rules. |
branches | Branches in repository. |
collaborators | List of repository collaborators. |
dependabot_security_updates_enabled | Whether dependabot security updates enabled for this repository. |
files | Files managed by this module. |
issue_labels | Repository issue labels. |
repository | Repository details. |
rulesets | Repository rulesets. |
secrets_and_variables | Repository Actions, Codespaces and Dependabot secrets and variables. |
tag_protections | Tag protection rules. |
webhooks | Repository webhooks. |