Skip to content

Commit acf3b6c

Browse files
committed
fix(ci): use !cancelled() instead of always() for dependent job conditions
Replace always() with !cancelled() to prevent jobs from running when the workflow is cancelled. Add explicit success/skip conditions for dependent jobs to ensure proper workflow execution flow.
1 parent b080c0b commit acf3b6c

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

.github/workflows/nix-build.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
checks-matrix:
8888
needs: [build-extensions-aarch64-linux, build-extensions-aarch64-darwin] #, build-extensions-x86_64-linux]
8989
if: |
90-
always() &&
90+
!cancelled() &&
9191
(needs.build-extensions-aarch64-linux.result == 'skipped' || needs.build-extensions-aarch64-linux.result == 'success') &&
9292
(needs.build-extensions-aarch64-darwin.result == 'skipped' || needs.build-extensions-aarch64-darwin.result == 'success')
9393
runs-on:
@@ -110,6 +110,9 @@ jobs:
110110
name: ${{ matrix.name }} (${{ matrix.system }})
111111
needs: [checks-matrix]
112112
runs-on: ${{ matrix.runs_on.group && matrix.runs_on || matrix.runs_on.labels }}
113+
if: |
114+
!cancelled() &&
115+
(needs.checks-matrix.result == 'skipped' || needs.checks-matrix.result == 'success')
113116
strategy:
114117
fail-fast: false
115118
matrix: ${{fromJSON(needs.checks-matrix.outputs.matrix)}}
@@ -123,5 +126,7 @@ jobs:
123126

124127
run-tests:
125128
needs: build-checks
126-
if: ${{ success() }}
129+
if: |
130+
!cancelled() &&
131+
(needs.build-checks.result == 'skipped' || needs.build-checks.result == 'success')
127132
uses: ./.github/workflows/test.yml

0 commit comments

Comments
 (0)