Skip to content

Commit 175c6b8

Browse files
🪲 [Fix]: Fix an issue that break the workflow when there is nothing to commit in BuildDocs (#137)
## Description This pull request updates the reusable workflow files to handle docs generation without errors. Improvements to reusable workflows (CI.yml and workflow.yml) : * In "BuildDocs": * Added `continue-on-error: true` and changed the shell to `pwsh` for the "Commit all changes" step. Also added commands to temporarily rename the `.gitignore` file during the commit process. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent da1f460 commit 175c6b8

File tree

4 files changed

+25
-3
lines changed

4 files changed

+25
-3
lines changed

.github/workflows/CI.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,10 +260,18 @@ jobs:
260260
Version: ${{ inputs.Version }}
261261

262262
- name: Commit all changes
263+
continue-on-error: true
264+
shell: pwsh
263265
run: |
266+
# Rename the gitignore file to .gitignore.bak
267+
Rename-Item -Path '.gitignore' -NewName '.gitignore.bak' -Force
268+
264269
git add .
265270
git commit -m 'Update documentation'
266271
272+
# Restore the gitignore file
273+
Rename-Item -Path '.gitignore.bak' -NewName '.gitignore' -Force
274+
267275
- name: Lint documentation
268276
uses: super-linter/super-linter/slim@latest
269277
env:

.github/workflows/workflow.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,18 @@ jobs:
267267
Version: ${{ inputs.Version }}
268268

269269
- name: Commit all changes
270+
continue-on-error: true
271+
shell: pwsh
270272
run: |
273+
# Rename the gitignore file to .gitignore.bak
274+
Rename-Item -Path '.gitignore' -NewName '.gitignore.bak' -Force
275+
271276
git add .
272277
git commit -m 'Update documentation'
273278
279+
# Restore the gitignore file
280+
Rename-Item -Path '.gitignore.bak' -NewName '.gitignore' -Force
281+
274282
- name: Lint documentation
275283
uses: super-linter/super-linter/slim@latest
276284
env:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
Register-ArgumentCompleter -CommandName New-PSModuleTest -ParameterName Name -ScriptBlock {
2+
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters)
3+
$null = $commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameters
4+
5+
'Alice', 'Bob', 'Charlie' | Where-Object { $_ -like "$wordToComplete*" } | ForEach-Object {
6+
[System.Management.Automation.CompletionResult]::new($_, $_, 'ParameterValue', $_)
7+
}
8+
}

tests/srcWithManifestTestRepo/src/functions/public/Test-PSModuleTest.ps1

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#SkipTest:Verbose:Just want to test that a function can have multiple skips.
2-
function Test-PSModuleTest {
1+
function Test-PSModuleTest {
32
<#
43
.SYNOPSIS
54
Performs tests on a module.
@@ -16,5 +15,4 @@ function Test-PSModuleTest {
1615
[string] $Name
1716
)
1817
Write-Output "Hello, $Name!"
19-
Write-Verbose 'Verbose message' -Verbose
2018
}

0 commit comments

Comments
 (0)