Skip to content

Commit

Permalink
adjusting job conditional logic
Browse files Browse the repository at this point in the history
  • Loading branch information
jdbass committed Mar 28, 2024
1 parent 4434791 commit 0ba4f1e
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions .github/workflows/iac_main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@ concurrency:

on:
push:
paths:
- tofu/environments/**
- tofu/modules/**
- .github/workflows/*

permissions:
id-token: write
Expand All @@ -21,8 +17,23 @@ env:
AWS_REGION: us-east-1

jobs:
iac-changes:
runs-on: ubuntu-latest
outputs:
run-iac: ${{ steps.check.outputs.run-iac }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: check
with:
filters: |
run-iac:
- 'tofu/**'
- '.github/workflows/**'
verify:
if: github.ref != 'refs/heads/main'
needs: iac-changes
if: github.ref != 'refs/heads/main' && needs.iac-changes.outputs.run-iac == 'true'
strategy:
max-parallel: 1
matrix:
Expand All @@ -36,7 +47,8 @@ jobs:
secrets: inherit

apply:
if: github.ref == 'refs/heads/main'
needs: iac-changes
if: github.ref == 'refs/heads/main' && needs.iac-changes.outputs.run-iac == 'true'
strategy:
max-parallel: 1
matrix:
Expand Down

0 comments on commit 0ba4f1e

Please sign in to comment.