Skip to content

Commit 2c2f875

Browse files
Merge pull request #122 from StartAutomating/HelpOut-Trim
HelpOut 0.4.4
2 parents 1713438 + 0fce9d4 commit 2c2f875

18 files changed

Lines changed: 380 additions & 173 deletions
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11

22
name: OnIssueOrRelease
33
on:
4-
issues:
54
workflow_dispatch:
65
release:
76
types:

.github/workflows/TestReleaseAndPublish.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,12 @@ jobs:
582582
uses: StartAutomating/PipeScript@main
583583
- name: UseEZOut
584584
uses: StartAutomating/EZOut@master
585-
- name: Run Help Out
585+
- name: Run Help Out (on master)
586+
if: ${{github.ref_name == 'master'}}
586587
uses: StartAutomating/HelpOut@master
587-
id: HelpOut
588+
id: HelpOutMaster
589+
- name: Run Help Out (on branch)
590+
if: ${{github.ref_name != 'master'}}
591+
uses: ./
592+
id: HelpOutBranch
588593

Assets/HelpOut.svg

Lines changed: 11 additions & 0 deletions
Loading

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
### 0.4.4
2+
3+
* Improved HelpOut action output (Fixes #121)
4+
* HelpOut has a logo (Fixes #120)
5+
* Save-MarkdownHelp now trims content (Fixes #119)
6+
7+
---
8+
19
### 0.4.3
210

311
* Action Improvements:

GitHub/Actions/HelpOutAction.ps1

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,30 @@ if ($PSD1Found) {
112112
"::notice title=ModuleLoaded::HelpOut Loaded from Path - $($HelpOutModulePath)" | Out-Host
113113

114114
$anyFilesChanged = $false
115-
$processScriptOutput = { process {
115+
$totalFilesOutputted = 0
116+
$totalFilesChanged = 0
117+
$filesOutputted = @()
118+
$filesChanged = @()
119+
120+
filter ProcessActionOutput {
116121
$out = $_
122+
117123
$outItem = Get-Item -Path $out -ErrorAction SilentlyContinue
124+
125+
$totalFilesOutputted++
118126
$fullName, $shouldCommit =
119127
if ($out -is [IO.FileInfo]) {
120128
if ($out.FullName -notlike "$repoRoot*") { return }
121129
$out.FullName, (git status $out.Fullname -s)
130+
$filesOutputted += $out
122131
} elseif ($outItem) {
123132
if ($outItem.FullName -notlike "$repoRoot*") { return }
124133
$outItem.FullName, (git status $outItem.Fullname -s)
134+
$filesOutputted += $outItem
125135
}
126136
if ($shouldCommit) {
127137
git add $fullName
138+
$filesChanged += $fullName
128139
if ($out.Message) {
129140
git commit -m "$($out.Message)" | Out-Host
130141
} elseif ($out.CommitMessage) {
@@ -133,9 +144,11 @@ $processScriptOutput = { process {
133144
git commit -m "$($gitHubEvent.head_commit.message)" | Out-Host
134145
}
135146
$anyFilesChanged = $true
147+
$totalFilesChanged++
136148
}
137149
$out
138-
} }
150+
}
151+
139152

140153

141154
if (-not $UserName) {
@@ -179,7 +192,7 @@ if (-not $LASTEXITCODE) {
179192
$HelpOutScriptStart = [DateTime]::Now
180193
if ($HelpOutScript) {
181194
Invoke-Expression -Command $HelpOutScript |
182-
. $processScriptOutput |
195+
. ProcessActionOutput |
183196
Out-Host
184197
}
185198
$HelpOutScriptTook = [Datetime]::Now - $HelpOutScriptStart
@@ -200,17 +213,23 @@ if (-not $SkipHelpOutPS1) {
200213
$HelpOutPS1Count++
201214
"::notice title=Running::$($_.Fullname)" | Out-Host
202215
. $_.FullName |
203-
. $processScriptOutput |
216+
. ProcessActionOutput |
204217
Out-Host
205218
}
206219
}
207220
}
208221

209222
$HelpOutPS1EndStart = [DateTime]::Now
210223
$HelpOutPS1Took = [Datetime]::Now - $HelpOutPS1Start
211-
"::group::$($HelpOutPS1List.Length) Files in $($HelpOutPS1Took.TotalMilliseconds)" | Out-Host
212-
$HelpOutPS1List -join ([Environment]::NewLine) | Out-Host
213-
"::endgroup::"
224+
"Ran $($HelpOutPS1List.Length) Files in $($HelpOutPS1Took.TotalMilliseconds)" | Out-Host
225+
if ($filesChanged) {
226+
"::group::$($filesOutputted.Length) files generated with $($filesChanged.Length) changes" | Out-Host
227+
$FilesChanged -join ([Environment]::NewLine) | Out-Host
228+
"::endgroup::" | Out-Host
229+
} else {
230+
"$($filesOutputted.Length) files generated with no changes"
231+
}
232+
214233
if ($CommitMessage -or $anyFilesChanged) {
215234
if ($CommitMessage) {
216235
Get-ChildItem $env:GITHUB_WORKSPACE -Recurse |

GitHub/Jobs/BuildHelpOut.psd1

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,19 @@
1212
id = 'PSSVG'
1313
},
1414
'RunPipeScript',
15-
'RunEZOut',
16-
'RunHelpOut'
15+
'RunEZOut',
16+
@{
17+
name = 'Run Help Out (on master)'
18+
if = '${{github.ref_name == ''master''}}'
19+
uses = 'StartAutomating/HelpOut@master'
20+
id = 'HelpOutMaster'
21+
},
22+
@{
23+
name = 'Run Help Out (on branch)'
24+
if = '${{github.ref_name != ''master''}}'
25+
uses = './'
26+
id = 'HelpOutBranch'
27+
}
28+
1729
)
1830
}

HelpOut-Help.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<maml:description>
99
<maml:para>Gets MAML help</maml:para>
1010
</maml:description>
11-
<dev:version>0.4.3</dev:version>
11+
<dev:version>0.4.4</dev:version>
1212
</command:details>
1313
<maml:description>
1414
<maml:para>Gets help for a given command, as MAML (Microsoft Assistance Markup Language) xml.</maml:para>
@@ -400,7 +400,7 @@ This slightly reduces the size of the MAML file, and reduces the rate of changes
400400
<maml:description>
401401
<maml:para>Gets Markdown Help</maml:para>
402402
</maml:description>
403-
<dev:version>0.4.3</dev:version>
403+
<dev:version>0.4.4</dev:version>
404404
</command:details>
405405
<maml:description>
406406
<maml:para>Gets Help for a given command, in Markdown</maml:para>
@@ -666,7 +666,7 @@ If not provided, this will be the order they are defined in the formatter.</maml
666666
<maml:description>
667667
<maml:para>Gets a script's references</maml:para>
668668
</maml:description>
669-
<dev:version>0.4.3</dev:version>
669+
<dev:version>0.4.4</dev:version>
670670
</command:details>
671671
<maml:description>
672672
<maml:para>Gets the external references of a given PowerShell command. These are the commands the script calls, and the types the script uses.</maml:para>
@@ -792,7 +792,7 @@ If not provided, this will be the order they are defined in the formatter.</maml
792792
<maml:description>
793793
<maml:para>Gets a Script's story</maml:para>
794794
</maml:description>
795-
<dev:version>0.4.3</dev:version>
795+
<dev:version>0.4.4</dev:version>
796796
</command:details>
797797
<maml:description>
798798
<maml:para>Gets the Script's "Story"</maml:para>
@@ -955,7 +955,7 @@ If not provided, this will be the order they are defined in the formatter.</maml
955955
<maml:description>
956956
<maml:para>Installs MAML into a module</maml:para>
957957
</maml:description>
958-
<dev:version>0.4.3</dev:version>
958+
<dev:version>0.4.4</dev:version>
959959
</command:details>
960960
<maml:description>
961961
<maml:para>Installs MAML into a module. </maml:para>
@@ -1309,7 +1309,7 @@ This slightly reduces the size of the MAML file, and reduces the rate of changes
13091309
<maml:description>
13101310
<maml:para>Determines the percentage of documentation</maml:para>
13111311
</maml:description>
1312-
<dev:version>0.4.3</dev:version>
1312+
<dev:version>0.4.4</dev:version>
13131313
</command:details>
13141314
<maml:description>
13151315
<maml:para>Determines the percentage of documentation in a given script</maml:para>
@@ -1452,7 +1452,7 @@ This slightly reduces the size of the MAML file, and reduces the rate of changes
14521452
<maml:description>
14531453
<maml:para>Saves a Module's MAML</maml:para>
14541454
</maml:description>
1455-
<dev:version>0.4.3</dev:version>
1455+
<dev:version>0.4.4</dev:version>
14561456
</command:details>
14571457
<maml:description>
14581458
<maml:para>Generates a Module's MAML file, and then saves it to the appropriate location.</maml:para>
@@ -1713,7 +1713,7 @@ This slightly reduces the size of the MAML file, and reduces the rate of changes
17131713
<maml:description>
17141714
<maml:para>Saves a Module's Markdown Help</maml:para>
17151715
</maml:description>
1716-
<dev:version>0.4.3</dev:version>
1716+
<dev:version>0.4.4</dev:version>
17171717
</command:details>
17181718
<maml:description>
17191719
<maml:para>Get markdown help for each command in a module and saves it to the appropriate location.</maml:para>
@@ -1737,7 +1737,7 @@ This slightly reduces the size of the MAML file, and reduces the rate of changes
17371737
<command:parameter required="false" position="named" pipelineInput="True (ByPropertyName)" aliases="" variableLength="true" globbing="false">
17381738
<maml:name>OutputPath</maml:name>
17391739
<maml:description>
1740-
<maml:para>The output path.
1740+
<maml:para>The output path.
17411741
If not provided, will be assumed to be the "docs" folder of a given module (unless -Wiki is specified)</maml:para>
17421742
</maml:description>
17431743
<command:parameterValue required="false" variableLength="true">String</command:parameterValue>
@@ -1806,7 +1806,7 @@ If provided without -OutputPath, will assume that a wiki resides in a sibling di
18061806
<maml:name>ScriptPath</maml:name>
18071807
<maml:description>
18081808
<maml:para>If provided, will generate documentation for any scripts found within these paths.
1809-
-ScriptPath can be either a file name or a full path.
1809+
-ScriptPath can be either a file name or a full path.
18101810
If an exact match is not found -ScriptPath will also check to see if there is a wildcard match.</maml:para>
18111811
</maml:description>
18121812
<command:parameterValue required="false" variableLength="true">System.String[]</command:parameterValue>
@@ -1995,7 +1995,7 @@ By default, .css, .gif, .htm, .html, .js, .jpg, .jpeg, .mp4, .png, .svg</maml:pa
19951995
<command:parameter required="false" position="named" pipelineInput="True (ByPropertyName)" aliases="" variableLength="true" globbing="false">
19961996
<maml:name>SkipCommandType</maml:name>
19971997
<maml:description>
1998-
<maml:para>A list of command types to skip.
1998+
<maml:para>A list of command types to skip.
19991999
If not provided, all types of commands from the module will be saved as a markdown document.</maml:para>
20002000
</maml:description>
20012001
<command:parameterValue required="false" variableLength="true">System.Management.Automation.CommandTypes[]</command:parameterValue>
@@ -2122,7 +2122,7 @@ By default ```\.help\.txt$``` and ```\.md$```</maml:para>
21222122
<command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false">
21232123
<maml:name>OutputPath</maml:name>
21242124
<maml:description>
2125-
<maml:para>The output path.
2125+
<maml:para>The output path.
21262126
If not provided, will be assumed to be the "docs" folder of a given module (unless -Wiki is specified)</maml:para>
21272127
</maml:description>
21282128
<command:parameterValue required="false" variableLength="true">String</command:parameterValue>
@@ -2229,7 +2229,7 @@ If not provided, will be assumed to be the "docs" folder of a given module (unle
22292229
<maml:name>ScriptPath</maml:name>
22302230
<maml:description>
22312231
<maml:para>If provided, will generate documentation for any scripts found within these paths.
2232-
-ScriptPath can be either a file name or a full path.
2232+
-ScriptPath can be either a file name or a full path.
22332233
If an exact match is not found -ScriptPath will also check to see if there is a wildcard match.</maml:para>
22342234
</maml:description>
22352235
<command:parameterValue required="false" variableLength="true">System.String[]</command:parameterValue>
@@ -2256,7 +2256,7 @@ If an exact match is not found -ScriptPath will also check to see if there is a
22562256
<command:parameter required="false" position="named" pipelineInput="False" aliases="" variableLength="true" globbing="false">
22572257
<maml:name>SkipCommandType</maml:name>
22582258
<maml:description>
2259-
<maml:para>A list of command types to skip.
2259+
<maml:para>A list of command types to skip.
22602260
If not provided, all types of commands from the module will be saved as a markdown document.</maml:para>
22612261
</maml:description>
22622262
<command:parameterValue required="false" variableLength="true">System.Management.Automation.CommandTypes[]</command:parameterValue>

HelpOut.GitHubWorkflow.PSDevOps.ps1

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ New-GitHubWorkflow -Name "Test, Tag, Release, and Publish" -On Demand, Push -Job
1212
TagReleaseAndPublish,
1313
BuildHelpOut -OutputPath .\.github\workflows\TestReleaseAndPublish.yml
1414

15-
New-GitHubWorkflow -On Issue,
16-
Demand,
17-
Released -Job RunGitPub -Name OnIssueOrRelease -OutputPath .\.github\workflows\OnIssue.yml
15+
New-GitHubWorkflow -On Demand,
16+
Released -Job RunGitPub -Name OnIssueOrRelease -OutputPath .\.github\workflows\GitPub.yml
1817

1918

2019
Pop-Location

HelpOut.PSSVG.ps1

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#requires -Module PSSVG
2+
3+
$psChevronPolygonPoints = @(
4+
"40,20"
5+
"45,20"
6+
"60,50"
7+
"35,80"
8+
"32.5,80"
9+
"55,50"
10+
) -join ' '
11+
12+
$psChevronPolygon =
13+
svg.polygon -Points $psChevronPolygonPoints
14+
15+
$psChevron =
16+
svg.symbol -Id psChevron -Content @(
17+
$psChevronPolygon
18+
) -ViewBox 100, 100 -PreserveAspectRatio $false
19+
20+
21+
22+
$assetsPath = Join-Path $psScriptRoot Assets
23+
24+
if (-not (Test-Path $assetsPath)) {
25+
$null = New-Item -ItemType Directory -Path $assetsPath -Force
26+
}
27+
28+
svg @(
29+
$psChevron
30+
svg.use -href '#psChevron' -X '67.5%' -Y '-2%' -Width '9.5%' -Stroke '#4488ff' -Fill '#4488ff' -Opacity .8
31+
svg.text @(
32+
svg.tspan "Help" -FontFamily 'sans-serif'
33+
svg.tspan "Out" -FontFamily 'sans-serif' -Dx '-0.3em' -Rotate 1 -Dy '0.0em' -FontSize 24 -Opacity .9
34+
) -FontSize 36 -Fill '#4488ff' -X 50% -DominantBaseline 'middle' -TextAnchor 'middle' -Y 50%
35+
) -ViewBox 300, 100 -OutputPath (Join-Path $assetsPath HelpOut.svg)

HelpOut.psd1

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,22 @@
66
Author='James Brundage'
77
ModuleToProcess='HelpOut.psm1'
88
FormatsToProcess='HelpOut.format.ps1xml'
9-
ModuleVersion='0.4.3'
9+
ModuleVersion='0.4.4'
1010
PrivateData = @{
1111
PSData = @{
1212
ProjectURI = 'https://github.com/StartAutomating/HelpOut'
1313
LicenseURI = 'https://github.com/StartAutomating/HelpOut/blob/master/LICENSE'
1414

1515
Tags = 'Markdown', 'Help','PowerShell'
1616
ReleaseNotes = @'
17+
### 0.4.4
18+
19+
* Improved HelpOut action output (Fixes #121)
20+
* HelpOut has a logo (Fixes #120)
21+
* Save-MarkdownHelp now trims content (Fixes #119)
22+
23+
---
24+
1725
### 0.4.3
1826
1927
* Action Improvements:

0 commit comments

Comments
 (0)