Skip to content

Commit d703e4c

Browse files
Copilotgreenc-FNAL
andauthored
Fix workflow_dispatch bypass: force evaluation of skipped dependency conditions (#324)
* Initial plan * Fix workflow_dispatch detection bypass in all check workflows Add always() to job conditions that check for skipped detect-changes. This forces GitHub Actions to evaluate the condition even when the detect-changes job is skipped (e.g., during workflow_dispatch). Without always(), GitHub Actions skips jobs before evaluating their if conditions when a needed job is skipped. Fixes workflow_dispatch invocation for: - coverage workflow - python-check workflow - cmake-build workflow - clang-format-check workflow - clang-tidy-check workflow - cmake-format-check workflow - actionlint-check workflow - jsonnet-format-check workflow - markdown-check workflow Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: greenc-FNAL <2372949+greenc-FNAL@users.noreply.github.com>
1 parent bda6402 commit d703e4c

File tree

9 files changed

+49
-24
lines changed

9 files changed

+49
-24
lines changed

.github/workflows/actionlint-check.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,13 @@ jobs:
107107
actionlint-check:
108108
needs: [pre-check, detect-changes]
109109
if: >
110-
needs.detect-changes.result == 'skipped' ||
110+
always() &&
111111
(
112-
needs.detect-changes.result == 'success' &&
113-
needs.detect-changes.outputs.has_changes == 'true'
112+
needs.detect-changes.result == 'skipped' ||
113+
(
114+
needs.detect-changes.result == 'success' &&
115+
needs.detect-changes.outputs.has_changes == 'true'
116+
)
114117
)
115118
runs-on: ubuntu-latest
116119
permissions:

.github/workflows/clang-format-check.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,13 @@ jobs:
6969
clang-format-check:
7070
needs: [pre-check, detect-changes]
7171
if: >
72-
needs.detect-changes.result == 'skipped' ||
72+
always() &&
7373
(
74-
needs.detect-changes.result == 'success' &&
75-
needs.detect-changes.outputs.has_changes == 'true'
74+
needs.detect-changes.result == 'skipped' ||
75+
(
76+
needs.detect-changes.result == 'success' &&
77+
needs.detect-changes.outputs.has_changes == 'true'
78+
)
7679
)
7780
runs-on: ubuntu-latest
7881
permissions:

.github/workflows/clang-tidy-check.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,13 @@ jobs:
7474
clang-tidy-check:
7575
needs: [pre-check, detect-changes]
7676
if: >
77-
needs.detect-changes.result == 'skipped' ||
77+
always() &&
7878
(
79-
needs.detect-changes.result == 'success' &&
80-
needs.detect-changes.outputs.has_changes == 'true'
79+
needs.detect-changes.result == 'skipped' ||
80+
(
81+
needs.detect-changes.result == 'success' &&
82+
needs.detect-changes.outputs.has_changes == 'true'
83+
)
8184
)
8285
runs-on: ubuntu-24.04
8386

.github/workflows/cmake-build.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ jobs:
174174
build:
175175
needs: [pre-check, detect-changes, generate-matrix]
176176
if: >
177+
always() &&
177178
needs.pre-check.result == 'success' &&
178179
(
179180
needs.detect-changes.result == 'skipped' ||

.github/workflows/cmake-format-check.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,13 @@ jobs:
103103
cmake-format-check:
104104
needs: [pre-check, detect-changes]
105105
if: >
106-
needs.detect-changes.result == 'skipped' ||
106+
always() &&
107107
(
108-
needs.detect-changes.result == 'success' &&
109-
needs.detect-changes.outputs.has_changes == 'true'
108+
needs.detect-changes.result == 'skipped' ||
109+
(
110+
needs.detect-changes.result == 'success' &&
111+
needs.detect-changes.outputs.has_changes == 'true'
112+
)
110113
)
111114
runs-on: ubuntu-latest
112115

.github/workflows/coverage.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,13 @@ jobs:
8484
coverage:
8585
needs: [pre-check, detect-changes]
8686
if: >
87-
needs.detect-changes.result == 'skipped' ||
87+
always() &&
8888
(
89-
needs.detect-changes.result == 'success' &&
90-
needs.detect-changes.outputs.has_changes == 'true'
89+
needs.detect-changes.result == 'skipped' ||
90+
(
91+
needs.detect-changes.result == 'success' &&
92+
needs.detect-changes.outputs.has_changes == 'true'
93+
)
9194
)
9295
runs-on: ubuntu-24.04
9396

.github/workflows/jsonnet-format-check.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ jobs:
104104
jsonnet-format-check:
105105
needs: [pre-check, detect-changes]
106106
if: >
107-
needs.detect-changes.result == 'skipped' ||
107+
always() &&
108108
(
109-
needs.detect-changes.result == 'success' &&
110-
needs.detect-changes.outputs.has_changes == 'true'
109+
needs.detect-changes.result == 'skipped' ||
110+
(
111+
needs.detect-changes.result == 'success' &&
112+
needs.detect-changes.outputs.has_changes == 'true'
113+
)
111114
)
112115
runs-on: ubuntu-latest
113116
container:

.github/workflows/markdown-check.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ jobs:
104104
markdown-check:
105105
needs: [pre-check, detect-changes]
106106
if: >
107-
needs.detect-changes.result == 'skipped' ||
107+
always() &&
108108
(
109-
needs.detect-changes.result == 'success' &&
110-
needs.detect-changes.outputs.has_changes == 'true'
109+
needs.detect-changes.result == 'skipped' ||
110+
(
111+
needs.detect-changes.result == 'success' &&
112+
needs.detect-changes.outputs.has_changes == 'true'
113+
)
111114
)
112115
runs-on: ubuntu-latest
113116
permissions:

.github/workflows/python-check.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,13 @@ jobs:
104104
python-check:
105105
needs: [pre-check, detect-changes]
106106
if: >
107-
needs.detect-changes.result == 'skipped' ||
107+
always() &&
108108
(
109-
needs.detect-changes.result == 'success' &&
110-
needs.detect-changes.outputs.has_changes == 'true'
109+
needs.detect-changes.result == 'skipped' ||
110+
(
111+
needs.detect-changes.result == 'success' &&
112+
needs.detect-changes.outputs.has_changes == 'true'
113+
)
111114
)
112115
runs-on: ubuntu-latest
113116
permissions:

0 commit comments

Comments
 (0)