add conditional check

This commit is contained in:
2026-04-05 17:25:26 -03:00
committed by GitHub
parent 3c3d8222ff
commit 9ac3152edb
+6 -1
View File
@@ -23,6 +23,8 @@ jobs:
terraform-plan:
if: ${{ github.event_name != 'workflow_run' || github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
outputs:
no_changes: ${{ steps.check-changes.outputs.no_changes }}
permissions:
contents: read
steps:
@@ -97,6 +99,7 @@ jobs:
run: terraform validate
- name: Terraform Plan
id: check-changes
working-directory: terraform
env:
AWS_ACCESS_KEY_ID: ${{ secrets.R2_ACCESS_KEY_ID }}
@@ -126,7 +129,9 @@ jobs:
terraform-apply:
runs-on: ubuntu-latest
needs: terraform-plan
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_run' || github.event.inputs.apply == 'true' }}
if: >
(github.event_name == 'push' || github.event_name == 'workflow_run' || inputs.apply == 'true')
&& needs.terraform-plan.outputs.no_changes == 'false'
environment:
name: production
permissions: