Skip to content

Commit aea6196

Browse files
authored
Merge pull request #1411 from maester365/copilot/fix-build-validation-checks
Fix build-validation workflow that blocks PRs without powershell changes. Also removes errors from the output when there are no test results to report.
2 parents 530d5d7 + 1f3e934 commit aea6196

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

.github/workflows/build-validation.yaml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77

88
pull_request:
99
branches: ["main"]
10-
paths:
11-
- 'powershell/**'
12-
- '.github/workflows/build-validation.yaml'
1310

1411
permissions:
1512
contents: read
@@ -27,16 +24,16 @@ jobs:
2724
os: [ubuntu-latest, windows-latest, macOS-latest]
2825

2926
steps:
30-
- uses: actions/checkout@v6.0.1
31-
- uses: dorny/paths-filter@v3
27+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
28+
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
3229
id: filter
3330
with:
34-
# This requires all patterns to match so exclusion works
35-
predicate-quantifier: "every"
3631
filters: |
3732
pwshmodule:
3833
- 'powershell/**'
39-
- "!powershell/Maester.psd1"
34+
- 'report/**'
35+
- 'tests/**'
36+
- '.github/workflows/build-validation.yaml'
4037
4138
- name: Install PowerShell dependencies
4239
if: steps.filter.outputs.pwshmodule == 'true'
@@ -63,8 +60,8 @@ jobs:
6360
# Run Pester tests on Windows PowerShell
6461
./powershell/tests/pester.ps1
6562
66-
- uses: actions/upload-artifact@v6.0.0 # upload test results
67-
if: success() || failure() # run this step even if previous step failed
63+
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
64+
if: (success() || failure()) && steps.filter.outputs.pwshmodule == 'true' # run this step even if previous step failed and tests were run
6865
with:
6966
name: test-results-${{ runner.os }}
7067
path: TestResults/*.xml

0 commit comments

Comments
 (0)