Skip to content

Commit ec5ece3

Browse files
🩹 [Patch]: Add Action-Test job with summary check to ensure step summary is not empty
1 parent e9ee8b9 commit ec5ece3

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

‎.github/workflows/Action-Test.yml‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,39 @@ jobs:
6666
VALIDATE_NATURAL_LANGUAGE: true
6767
VALIDATE_ALL_CODEBASE: true
6868
USE_FIND_ALGORITHM: true
69+
70+
ActionTestWithSummary:
71+
name: Action-Test - [With Summary]
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout repo
75+
uses: actions/checkout@v5
76+
with:
77+
persist-credentials: false
78+
fetch-depth: 0
79+
80+
- name: Upload module artifact
81+
uses: actions/upload-artifact@v4
82+
with:
83+
name: module
84+
path: tests/srcTestRepo/outputs/module
85+
if-no-files-found: error
86+
retention-days: 1
87+
88+
- name: Action-Test
89+
uses: ./
90+
with:
91+
Name: PSModuleTest
92+
WorkingDirectory: tests/srcTestRepo
93+
ShowSummaryOnSuccess: true
94+
95+
- name: Check step summary is not empty
96+
shell: pwsh
97+
run: |
98+
$summary = Get-Content $env:GITHUB_STEP_SUMMARY -Raw
99+
Write-Host "Step summary:"
100+
Write-Host "[$summary]"
101+
if ([string]::IsNullOrEmpty($summary)) {
102+
throw "Step summary is empty, but expected not to be."
103+
}
104+
Write-Host "Step summary is not empty as expected."

0 commit comments

Comments
 (0)