From 16f6e9fcafe24fbde866b68c8aa53194c9d12926 Mon Sep 17 00:00:00 2001 From: Mikkel Christensen Date: Wed, 12 Nov 2025 12:20:50 +0100 Subject: [PATCH 1/4] Attempt with a simpler collector step --- .github/workflows/paths-filtering-tests.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/paths-filtering-tests.yml b/.github/workflows/paths-filtering-tests.yml index 0feaa66..f097450 100644 --- a/.github/workflows/paths-filtering-tests.yml +++ b/.github/workflows/paths-filtering-tests.yml @@ -44,6 +44,4 @@ jobs: if: ${{ always() }} runs-on: ubuntu-latest steps: - # If changes are not in scope, we're good. The 'skipped' value check is just a safeguard. - - if: ${{ needs.changes.outputs.inScope != 'true' && needs.in-scope.result == 'skipped' }} - run: exit 0 + - run: exit ${{ needs.in-scope.result == 'success' || needs.changes.outputs.inScope != 'true' }} From 4e192ba86327cf89feec9bf16c8acfd6d79378ad Mon Sep 17 00:00:00 2001 From: Mikkel Christensen Date: Wed, 12 Nov 2025 12:38:03 +0100 Subject: [PATCH 2/4] Attempt to convert a bool to int via a ternary, and also naming the corresponding variable. --- .github/workflows/paths-filtering-tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/paths-filtering-tests.yml b/.github/workflows/paths-filtering-tests.yml index f097450..b6f2cb0 100644 --- a/.github/workflows/paths-filtering-tests.yml +++ b/.github/workflows/paths-filtering-tests.yml @@ -43,5 +43,7 @@ jobs: needs: [changes, in-scope] if: ${{ always() }} runs-on: ubuntu-latest + env: + exitCode: ${{ (needs.in-scope.result == 'success' || needs.changes.outputs.inScope != 'true') && 1 || 0 }} steps: - - run: exit ${{ needs.in-scope.result == 'success' || needs.changes.outputs.inScope != 'true' }} + - run: exit ${{ env.exitCode }} From 2dff428a1bde1cf20e6ec6d755fa639e92d17f04 Mon Sep 17 00:00:00 2001 From: Mikkel Christensen Date: Wed, 12 Nov 2025 12:39:37 +0100 Subject: [PATCH 3/4] Reversing integere values returned by ternary (0 means success in an exit code). --- .github/workflows/paths-filtering-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/paths-filtering-tests.yml b/.github/workflows/paths-filtering-tests.yml index b6f2cb0..1e04e9d 100644 --- a/.github/workflows/paths-filtering-tests.yml +++ b/.github/workflows/paths-filtering-tests.yml @@ -44,6 +44,6 @@ jobs: if: ${{ always() }} runs-on: ubuntu-latest env: - exitCode: ${{ (needs.in-scope.result == 'success' || needs.changes.outputs.inScope != 'true') && 1 || 0 }} + exitCode: ${{ (needs.in-scope.result == 'success' || needs.changes.outputs.inScope != 'true') && 0 || 1 }} steps: - run: exit ${{ env.exitCode }} From 7f3fec7ec72c8038044f360025feda639b989c43 Mon Sep 17 00:00:00 2001 From: Mikkel Christensen Date: Wed, 12 Nov 2025 12:57:33 +0100 Subject: [PATCH 4/4] Spelling out an if-else-compatible construction to avoid invisible conversions and having to work with bash literals and comparisons. --- .github/workflows/paths-filtering-tests.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/paths-filtering-tests.yml b/.github/workflows/paths-filtering-tests.yml index 1e04e9d..715b266 100644 --- a/.github/workflows/paths-filtering-tests.yml +++ b/.github/workflows/paths-filtering-tests.yml @@ -44,6 +44,9 @@ jobs: if: ${{ always() }} runs-on: ubuntu-latest env: - exitCode: ${{ (needs.in-scope.result == 'success' || needs.changes.outputs.inScope != 'true') && 0 || 1 }} + checkPassed: ${{ needs.in-scope.result == 'success' || needs.changes.outputs.inScope != 'true' }} steps: - - run: exit ${{ env.exitCode }} + - if: ${{ env.checkPassed }} + run: exit 0 + - if: ${{ !env.checkPassed }} + run: exit 1