Skip to content

Commit

Permalink
chore: test 3 (#3)
Browse files Browse the repository at this point in the history
* chore: test 3

* Add variable

* Remove the vars file

* Removed references to the nonexistent vars file

* Fix the variable name
  • Loading branch information
wheelerlaw authored Dec 25, 2023
1 parent 45c3ce2 commit 5796ab3
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
- name: Terraform plan
env:
GITHUB_TOKEN: ${{ steps.generate-app-token.outputs.token }}
run: terraform plan -var-file=secrets.tfvars | tee >(ansi2txt > terraform.tfplan.log)
run: terraform plan | tee >(ansi2txt > terraform.tfplan.log)
- name: Create release body
run: |
cat \
Expand Down Expand Up @@ -129,7 +129,7 @@ jobs:
- name: Terraform apply
env:
GITHUB_TOKEN: ${{ steps.generate-app-token.outputs.token }}
run: terraform apply -var-file=secrets.tfvars -auto-approve | tee >(ansi2txt > terraform.apply.log)
run: terraform apply -auto-approve | tee >(ansi2txt > terraform.apply.log)
- name: Encrypt statefile
run: |
# step script
Expand Down
36 changes: 21 additions & 15 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,26 @@ provider "github" {
owner = "SteelecoSystems"
}

resource "github_actions_secret" "test_secret" {
secret_name = "SECRET_NAME"
plaintext_value = "SECRET_${var.secret_name}"
repository = "tf-test"
resource "github_actions_variable" "test-variable" {
repository = "tf-test"
value = "hello world"
variable_name = "TEST_VARIABLE"
}

resource "github_actions_secret" "test_secret_2" {
secret_name = "SECRET_${var.secret_name}"
plaintext_value = "SECRET_${var.secret_name}"
repository = "tf-test"
}

variable "secret_name" {
description = "The secret name"
type = string
sensitive = true
}
#resource "github_actions_secret" "test_secret" {
# secret_name = "SECRET_NAME"
# plaintext_value = "SECRET_${var.secret_name}"
# repository = "tf-test"
#}
#
#resource "github_actions_secret" "test_secret_2" {
# secret_name = "SECRET_${var.secret_name}"
# plaintext_value = "SECRET_${var.secret_name}"
# repository = "tf-test"
#}
#
#variable "secret_name" {
# description = "The secret name"
# type = string
# sensitive = true
#}
1 change: 0 additions & 1 deletion secrets.tfvars

This file was deleted.

0 comments on commit 5796ab3

Please sign in to comment.