Skip to content

Commit c659d10

Browse files
Copilotgreenc-FNAL
andauthored
fix: wire workflow_call inputs, act fallback for change detection, and correct clang-tidy/format-all failure behavior (#421)
* Initial plan * fix: wire workflow_call inputs, act fallback for change detection, and clang-tidy/format-all failures 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 4ad0275 commit c659d10

File tree

9 files changed

+44
-2
lines changed

9 files changed

+44
-2
lines changed

.github/actions/workflow-setup/action.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ outputs:
5757
value: ${{ steps.prepare.outputs.build_path }}
5858
has_changes:
5959
description: "Whether relevant changes were detected"
60-
value: ${{ steps.detect.outputs.has_changes }}
60+
value: ${{ steps.changes.outputs.has_changes }}
6161

6262
runs:
6363
using: "composite"
@@ -112,7 +112,7 @@ runs:
112112
113113
- name: Run change detection
114114
id: detect
115-
if: inputs.file-type != '' || inputs.include-globs != ''
115+
if: (inputs.file-type != '' || inputs.include-globs != '') && steps.prepare.outputs.is_act != 'true'
116116
uses: Framework-R-D/phlex/.github/actions/run-change-detection@main
117117
with:
118118
checkout-path: ${{ steps.prepare.outputs.checkout_path }}
@@ -123,3 +123,14 @@ runs:
123123
include-globs: ${{ inputs.include-globs }}
124124
exclude-globs: ${{ inputs.exclude-globs }}
125125
head-ref: ${{ inputs.head-ref }}
126+
127+
- name: Set has_changes output
128+
id: changes
129+
shell: bash
130+
run: |
131+
if [ "${{ steps.prepare.outputs.is_act }}" = "true" ] && \
132+
([ "${{ inputs.file-type }}" != "" ] || [ "${{ inputs.include-globs }}" != "" ]); then
133+
echo "has_changes=true" >> "$GITHUB_OUTPUT"
134+
else
135+
echo "has_changes=${{ steps.detect.outputs.has_changes }}" >> "$GITHUB_OUTPUT"
136+
fi

.github/workflows/actionlint-check.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ jobs:
6363
.github/actions/**/*.yml
6464
.github/actions/**/*.yaml
6565
head-ref: ${{ inputs.pr-head-sha }}
66+
ref: ${{ inputs.ref }}
67+
repo: ${{ inputs.repo }}
68+
pr-base-sha: ${{ inputs.pr-base-sha }}
69+
checkout-path: ${{ inputs.checkout-path }}
6670

6771
actionlint-check:
6872
needs: setup

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ jobs:
9191
exit 1
9292
elif grep -qE '^/.+\.(cpp|hpp|c|h):[0-9]+:[0-9]+: (warning|error):' clang-tidy.log; then
9393
echo "::warning::Clang-tidy found issues in the code"
94+
exit 1
9495
else
9596
echo "✅ clang-tidy check passed"
9697
fi

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ jobs:
5959
with:
6060
file-type: cmake
6161
head-ref: ${{ inputs.pr-head-sha }}
62+
ref: ${{ inputs.ref }}
63+
repo: ${{ inputs.repo }}
64+
pr-base-sha: ${{ inputs.pr-base-sha }}
65+
checkout-path: ${{ inputs.checkout-path }}
6266

6367
cmake-format-check:
6468
needs: setup

.github/workflows/format-all.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,9 @@ jobs:
120120
uses: Framework-R-D/phlex/.github/actions/complete-pr-comment@main
121121
with:
122122
status: ${{ steps.collect.outputs.has_failures == 'true' && 'failure' || 'success' }}
123+
124+
- name: Fail on formatter failures
125+
if: steps.collect.outputs.has_failures == 'true'
126+
run: |
127+
echo "One or more formatters failed, were canceled, or were skipped."
128+
exit 1

.github/workflows/header-guards-check.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ jobs:
5959
with:
6060
file-type: cpp
6161
head-ref: ${{ inputs.pr-head-sha }}
62+
ref: ${{ inputs.ref }}
63+
repo: ${{ inputs.repo }}
64+
pr-base-sha: ${{ inputs.pr-base-sha }}
65+
checkout-path: ${{ inputs.checkout-path }}
6266

6367
header-guards-check:
6468
needs: setup

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ jobs:
5959
with:
6060
file-type: jsonnet
6161
head-ref: ${{ inputs.pr-head-sha }}
62+
ref: ${{ inputs.ref }}
63+
repo: ${{ inputs.repo }}
64+
pr-base-sha: ${{ inputs.pr-base-sha }}
65+
checkout-path: ${{ inputs.checkout-path }}
6266

6367
jsonnet-format-check:
6468
needs: setup

.github/workflows/markdown-check.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ jobs:
5959
with:
6060
file-type: md
6161
head-ref: ${{ inputs.pr-head-sha }}
62+
ref: ${{ inputs.ref }}
63+
repo: ${{ inputs.repo }}
64+
pr-base-sha: ${{ inputs.pr-base-sha }}
65+
checkout-path: ${{ inputs.checkout-path }}
6266

6367
markdown-check:
6468
needs: setup

.github/workflows/python-check.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ jobs:
5959
with:
6060
file-type: python
6161
head-ref: ${{ inputs.pr-head-sha }}
62+
ref: ${{ inputs.ref }}
63+
repo: ${{ inputs.repo }}
64+
pr-base-sha: ${{ inputs.pr-base-sha }}
65+
checkout-path: ${{ inputs.checkout-path }}
6266

6367
python-check:
6468
needs: setup

0 commit comments

Comments
 (0)