diff --git a/.github/workflows/terraform.yml b/.github/workflows/terraform.yml index b005fb1..c06f685 100644 --- a/.github/workflows/terraform.yml +++ b/.github/workflows/terraform.yml @@ -1,7 +1,7 @@ # This workflow installs the latest version of Terraform CLI and configures the Terraform CLI configuration file # with an API token for Terraform Cloud (app.terraform.io). On pull request events, this workflow will run # `terraform init`, `terraform fmt`, and `terraform plan` (speculative plan via Terraform Cloud). On push events -# to the "main" branch, `terraform apply` will be executed. +# to the $default-branch branch, `terraform apply` will be executed. # # Documentation for `hashicorp/setup-terraform` is located here: https://github.com/hashicorp/setup-terraform # @@ -46,7 +46,7 @@ name: 'Terraform' on: push: - branches: [ "main" ] + branches: [ $default-branch ] pull_request: permissions: @@ -84,10 +84,10 @@ jobs: # Generates an execution plan for Terraform - name: Terraform Plan - run: terraform plan -input=true + run: terraform plan -input=false - # On push to "main", build or change infrastructure according to Terraform configuration files + # On push to $default-branch, build or change infrastructure according to Terraform configuration files # Note: It is recommended to set up a required "strict" status check in your repository for "Terraform Cloud". See the documentation on "strict" required status checks for more information: https://help.github.com/en/github/administering-a-repository/types-of-required-status-checks - name: Terraform Apply - if: github.ref == 'refs/heads/"main"' && github.event_name == 'push' - run: terraform apply -auto-approve -input=true + if: github.ref == 'refs/heads/$default-branch' && github.event_name == 'push' + run: terraform apply -auto-approve -input=false