From 6c6bb1854caf5f8176ba59ca64397002fd76d1a8 Mon Sep 17 00:00:00 2001 From: Eric Chen Date: Wed, 27 Nov 2024 17:01:13 +0800 Subject: [PATCH] Revert "Update apply logic (#112)" This reverts commit ae46d05edd6fcdf554073ae3b8c14505038fed63. --- .github/workflows/terraform-apply.yaml | 6 ++---- terraform-plans/main.tf | 12 +++++------- terraform-plans/variables.tf | 12 ------------ 3 files changed, 7 insertions(+), 23 deletions(-) diff --git a/.github/workflows/terraform-apply.yaml b/.github/workflows/terraform-apply.yaml index af7e03f..dc2410b 100644 --- a/.github/workflows/terraform-apply.yaml +++ b/.github/workflows/terraform-apply.yaml @@ -117,12 +117,10 @@ jobs: terraform plan -no-color \ -var-file=configs/github.tfvars \ -var-file=configs/${{ matrix.repository }}.tfvars \ - -var="pr_branch_prefix=${{ github.head_ref }}" \ - -var="pr_body=This is an automated pull request from https://github.com/${{ github.repository }}/pull/${{ github.event.number }} to update centrally managed files." \ -out ./tf.plan - - name: Terraform apply (if running on non-draft PR) - if: github.event.pull_request.draft == false + - name: Terraform apply (if running from main branch) + if: ${{ github.ref_name == 'main' }} working-directory: ./terraform-plans env: GITHUB_APP_ID: ${{ secrets.SOLENG_APP_ID }} diff --git a/terraform-plans/main.tf b/terraform-plans/main.tf index ba0b5ba..ec56d43 100644 --- a/terraform-plans/main.tf +++ b/terraform-plans/main.tf @@ -7,13 +7,11 @@ module "github_settings" { } module "github_templates" { - source = "./modules/GitHub/templates" - owner = var.owner - repository = var.repository - branch = var.branch - templates = var.templates - pr_branch_prefix = var.pr_branch_prefix - pr_body = var.pr_body + source = "./modules/GitHub/templates" + owner = var.owner + repository = var.repository + branch = var.branch + templates = var.templates } output "repository" { diff --git a/terraform-plans/variables.tf b/terraform-plans/variables.tf index 3ad27d0..363747e 100644 --- a/terraform-plans/variables.tf +++ b/terraform-plans/variables.tf @@ -31,15 +31,3 @@ variable "templates" { })) description = "Files to be templated into the target GitHub repository." } - -variable "pr_branch_prefix" { - type = string - description = "Pull request branch name prefix." - default = "automation/update-managed-files" -} - -variable "pr_body" { - type = string - description = "Pull request body message." - default = "This is an automated pull request from https://github.com/canonical/solutions-engineering-automation to update centrally managed files." -}