From 9eb6fa82a43950f1f20845fb6b9b5f860e2cf42f Mon Sep 17 00:00:00 2001 From: Enderson Maia Date: Mon, 4 Sep 2023 16:47:33 +0100 Subject: [PATCH] fixup! ci: limit build to changed templates --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 60177d1..d6cd238 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -25,7 +25,7 @@ jobs: echo "ALL_TEMPLATES=$(find ./ -name Dockerfile | awk -F/ '/^[a-z]*\// {print $1}' | sort -u | jq -Rnc '[inputs]')" >> "$GITHUB_OUTPUT" build-on-main: - if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && needs.changedfiles.outputs.allTemplates}} + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && (needs.changedfiles.outputs.changedTemplates != '' && toJson(fromjson(needs.changedfiles.outputs.changedTemplates)) ! = '[]') }} needs: changedfiles name: sunodo build ${{ matrix.allTemplates }} runs-on: ubuntu-latest @@ -55,7 +55,7 @@ jobs: working-directory: ${{ matrix.ALL_TEMPLATES }} build-on-pr: - if: ${{ github.event_name == 'pull_request' && needs.changedfiles.outputs.changedTemplates }} + if: ${{ github.event_name == 'pull_request' && (needs.changedfiles.outputs.changedTemplates != '' && toJson(fromjson(needs.changedfiles.outputs.changedTemplates)) ! = '[]') }} needs: changedfiles name: sunodo build ${{ matrix.changedTemplates }} runs-on: ubuntu-latest