mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-01-27 10:18:54 +00:00
chore(ci): Do not run terraform plan in PRs when there are no changes (#5964)
This commit is contained in:
17
.github/workflows/_terraform.yml
vendored
17
.github/workflows/_terraform.yml
vendored
@@ -32,7 +32,14 @@ jobs:
|
||||
working-directory: terraform
|
||||
run: |
|
||||
terraform fmt --check --recursive
|
||||
- name: Upload Configuration
|
||||
- uses: dorny/paths-filter@v3
|
||||
id: changes
|
||||
with:
|
||||
filters: |
|
||||
terraform:
|
||||
- 'terraform/**'
|
||||
- if: steps.changes.outputs.terraform == 'true'
|
||||
name: Upload Configuration
|
||||
uses: hashicorp/tfc-workflows-github/actions/upload-configuration@v1.3.0
|
||||
id: plan-upload
|
||||
with:
|
||||
@@ -41,7 +48,8 @@ jobs:
|
||||
# https://app.terraform.io/app/firezone/workspaces/staging/settings/general
|
||||
directory: "./"
|
||||
speculative: true
|
||||
- name: Create Plan Run
|
||||
- if: steps.changes.outputs.terraform == 'true'
|
||||
name: Create Plan Run
|
||||
uses: hashicorp/tfc-workflows-github/actions/create-run@v1.3.0
|
||||
id: plan-run
|
||||
env:
|
||||
@@ -51,7 +59,8 @@ jobs:
|
||||
configuration_version:
|
||||
${{ steps.plan-upload.outputs.configuration_version_id }}
|
||||
plan_only: true
|
||||
- name: Get Plan Output
|
||||
- if: steps.changes.outputs.terraform == 'true'
|
||||
name: Get Plan Output
|
||||
uses: hashicorp/tfc-workflows-github/actions/plan-output@v1.3.0
|
||||
id: plan-output
|
||||
with:
|
||||
@@ -59,7 +68,7 @@ jobs:
|
||||
- name: Update PR
|
||||
uses: actions/github-script@v7
|
||||
id: plan-comment
|
||||
if: ${{ github.event_name == 'pull_request' }}
|
||||
if: ${{ github.event_name == 'pull_request' && steps.changes.outputs.terraform == 'true' }}
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
|
||||
Reference in New Issue
Block a user