Skip to content

Commit

Permalink
Add a workflow that runs terraform plan on PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
offbyone committed Dec 1, 2023
1 parent 29fc462 commit 2e34fc1
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/pr-plan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: 'Terraform Plan'

on:
workflow_dispatch:
pull_request:
branches:
- 'main'
- mainline

jobs:
terraform:
name: 'Terraform Plan'
runs-on: ubuntu-latest

steps:
- name: 'Checkout Repository'
uses: actions/checkout@v3

- name: 'Setup Terraform'
uses: hashicorp/setup-terraform@v1
with:
terraform_version: '1.4.6' # Replace with your desired version

- name: 'Terraform Init'
id: init
run: terraform init

- name: 'Terraform Plan'
id: plan
run: terraform plan
# If the Terraform plan fails, the workflow will fail and stop executing further steps.
```

0 comments on commit 2e34fc1

Please sign in to comment.