Skip to content

Commit 760e360

Browse files
Fix Functions index verification checks
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
1 parent 4eae959 commit 760e360

2 files changed

Lines changed: 20 additions & 12 deletions

File tree

.github/workflows/Workflow-Test-Default.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
fetch-depth: 0
6262

6363
- name: Download docs artifact
64-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
64+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
6565
with:
6666
name: docs
6767
path: tests/srcTestRepo/outputs/docs
@@ -71,18 +71,22 @@ jobs:
7171
run: |
7272
$path = 'tests/srcTestRepo/outputs/docs/index.md'
7373
if (-not (Test-Path -Path $path)) {
74-
throw 'Expected root Functions index at tests/srcTestRepo/outputs/docs/index.md.'
74+
throw 'Expected root Functions index at ' +
75+
'tests/srcTestRepo/outputs/docs/index.md.'
7576
}
7677
7778
$content = Get-Content -Path $path -Raw
7879
$expectedSnippets = @(
7980
'# Functions'
80-
'This landing page is authored from the root of `src/functions/public`.'
81-
'Use it to introduce the module''s function surface before readers drill into each group.'
81+
'This landing page is authored from the root of ' +
82+
'`src/functions/public`.'
83+
'Use it to introduce the module''s function surface ' +
84+
'before readers drill into each group.'
8285
)
8386
8487
foreach ($snippet in $expectedSnippets) {
85-
if ($content -notlike "*$snippet*") {
86-
throw "Expected snippet not found in generated root Functions index: $snippet"
88+
if (-not $content.Contains($snippet)) {
89+
throw 'Expected snippet not found in generated root ' +
90+
"Functions index: $snippet"
8791
}
8892
}

.github/workflows/Workflow-Test-WithManifest.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
fetch-depth: 0
6262

6363
- name: Download docs artifact
64-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
64+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c
6565
with:
6666
name: docs
6767
path: tests/srcWithManifestTestRepo/outputs/docs
@@ -71,18 +71,22 @@ jobs:
7171
run: |
7272
$path = 'tests/srcWithManifestTestRepo/outputs/docs/index.md'
7373
if (-not (Test-Path -Path $path)) {
74-
throw 'Expected root Functions index at tests/srcWithManifestTestRepo/outputs/docs/index.md.'
74+
throw 'Expected root Functions index at ' +
75+
'tests/srcWithManifestTestRepo/outputs/docs/index.md.'
7576
}
7677
7778
$content = Get-Content -Path $path -Raw
7879
$expectedSnippets = @(
7980
'# Functions'
80-
'This landing page is authored from the root of `src/functions/public`.'
81-
'Use it to introduce the module''s function surface before readers drill into each group.'
81+
'This landing page is authored from the root of ' +
82+
'`src/functions/public`.'
83+
'Use it to introduce the module''s function surface ' +
84+
'before readers drill into each group.'
8285
)
8386
8487
foreach ($snippet in $expectedSnippets) {
85-
if ($content -notlike "*$snippet*") {
86-
throw "Expected snippet not found in generated root Functions index: $snippet"
88+
if (-not $content.Contains($snippet)) {
89+
throw 'Expected snippet not found in generated root ' +
90+
"Functions index: $snippet"
8791
}
8892
}

0 commit comments

Comments
 (0)