From 126cd0eb046fcecc0c1035f46385a52fabc953fb Mon Sep 17 00:00:00 2001 From: Jim Martens Date: Wed, 30 Jul 2025 22:35:33 +0200 Subject: [PATCH] fix: Skip environment if it wasn't changed --- .github/workflows/deploy.yaml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index c765a2c..468fed6 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -24,10 +24,16 @@ jobs: strategy: matrix: env: [ test ] - if: contains(needs.fact-finding.outputs.changed_envs, matrix.env) environment: ${{ matrix.env }} steps: - uses: actions/checkout@v4 + - name: Exit if this environment wasn't changed + run: | + echo "Changed envs: '${{ needs.fact-finding.outputs.changed_envs }}'" + if [[ ! " ${{ needs.fact-finding.outputs.changed_envs }} " =~ " ${{ matrix.env }} " ]]; then + echo "Environment '${{ matrix.env }}' was not modified. Skipping." + exit 0 + fi - name: Build & push Nginx image to GHCR if: steps.detect.outputs.changed_envs != '' run: |