From 08ab229e1e9481ed6b80faae28f1eff84da46e93 Mon Sep 17 00:00:00 2001 From: Amir Ghafari Date: Fri, 1 Jul 2022 23:59:00 +0430 Subject: [PATCH] add example:github easy-github-repository-add-new-file --- .../easy-github-repository-add-new-file/README.md | 0 .../easy-github-repository-add-new-file/main.tf | 12 ++++++++++++ .../easy-github-repository-add-new-file/providers.tf | 5 +++++ .../easy-github-repository-add-new-file/terraform.tf | 10 ++++++++++ .../easy-github-repository-add-new-file/variables.tf | 9 +++++++++ 5 files changed, 36 insertions(+) create mode 100644 examples/github/easy-github-repository-add-new-file/README.md create mode 100644 examples/github/easy-github-repository-add-new-file/main.tf create mode 100644 examples/github/easy-github-repository-add-new-file/providers.tf create mode 100644 examples/github/easy-github-repository-add-new-file/terraform.tf create mode 100644 examples/github/easy-github-repository-add-new-file/variables.tf diff --git a/examples/github/easy-github-repository-add-new-file/README.md b/examples/github/easy-github-repository-add-new-file/README.md new file mode 100644 index 0000000..e69de29 diff --git a/examples/github/easy-github-repository-add-new-file/main.tf b/examples/github/easy-github-repository-add-new-file/main.tf new file mode 100644 index 0000000..fee06fc --- /dev/null +++ b/examples/github/easy-github-repository-add-new-file/main.tf @@ -0,0 +1,12 @@ +# https://github.com/ssbostan/terraform-awesome + +resource "github_repository_file" "simple_github_repository_file" { + repository = var.github_repository + branch = "main" + file = "simple_file" + content = "This file was created by Terraform." + commit_message = "Managed by Terraform" + commit_author = "Terraform User" + commit_email = "example@terraform.com" + overwrite_on_create = true +} \ No newline at end of file diff --git a/examples/github/easy-github-repository-add-new-file/providers.tf b/examples/github/easy-github-repository-add-new-file/providers.tf new file mode 100644 index 0000000..4169eea --- /dev/null +++ b/examples/github/easy-github-repository-add-new-file/providers.tf @@ -0,0 +1,5 @@ +# https://github.com/ssbostan/terraform-awesome + +provider "github" { + token = var.github_token +} \ No newline at end of file diff --git a/examples/github/easy-github-repository-add-new-file/terraform.tf b/examples/github/easy-github-repository-add-new-file/terraform.tf new file mode 100644 index 0000000..cf8d6c6 --- /dev/null +++ b/examples/github/easy-github-repository-add-new-file/terraform.tf @@ -0,0 +1,10 @@ +# https://github.com/ssbostan/terraform-awesome + +terraform { + required_providers { + github = { + source = "integrations/github" + version = "~> 4.0" + } + } +} \ No newline at end of file diff --git a/examples/github/easy-github-repository-add-new-file/variables.tf b/examples/github/easy-github-repository-add-new-file/variables.tf new file mode 100644 index 0000000..36056c1 --- /dev/null +++ b/examples/github/easy-github-repository-add-new-file/variables.tf @@ -0,0 +1,9 @@ +# https://github.com/ssbostan/terraform-awesome + +variable "github_token" { + type = string +} + +variable "github_repository" { + type = string # Your repository to add file +} \ No newline at end of file