Skip to content

Commit

Permalink
appropriately catch error
Browse files Browse the repository at this point in the history
  • Loading branch information
tjcorr authored Oct 7, 2021
1 parent 9cf737b commit d35877b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/terraform.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,13 @@ jobs:
run: terraform plan -detailed-exitcode -out tfplan || exit 0
id: tf-plan

# consider publishing error to PR
- name: Check Terraform Plan Exit Code
run: echo last code ${{ steps.tf-plan.outputs.exitcode }}
run: |
if [ ${{ steps.tf-plan.outputs.exitcode }} -eq 1 ] then
echo Terraform Plan Failed!
exit 1
fi
# Save plan to artifacts
- name: Publish Terraform State
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ provider "azurerm" {
features {}
}

resource "azurerm_resource_groupdfsa" "rg-aks" {
resource "azurerm_resource_groupasfd" "rg-aks" {
name = var.resource_group_name
location = var.location
}

0 comments on commit d35877b

Please sign in to comment.