Skip to content

Commit

Permalink
Update terraform.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
574n13y authored Dec 31, 2023
1 parent 6f6261c commit ac1967b
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
@@ -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
#
Expand Down Expand Up @@ -46,7 +46,7 @@ name: 'Terraform'

on:
push:
branches: [ "main" ]
branches: [ $default-branch ]
pull_request:

permissions:
Expand Down Expand Up @@ -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

0 comments on commit ac1967b

Please sign in to comment.