Skip to content

Commit 2294313

Browse files
Merge pull request #120 from WarehouseFinds/fix/docs_update
Refactor build tasks and update documentation references in CI workflows
2 parents e26c5cb + 49f93cd commit 2294313

File tree

9 files changed

+85
-649
lines changed

9 files changed

+85
-649
lines changed

.github/README_template.md

Lines changed: 25 additions & 341 deletions
Large diffs are not rendered by default.

.github/actions/ps-code-injection/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
shell: pwsh
2424
run: |
2525
Set-StrictMode -Version Latest
26-
Invoke-Build -Task Invoke-InjectionHunter
26+
Invoke-Build -Task InjectionHunter
2727
2828
- name: Publish Code Injection Analysis Results
2929
uses: EnricoMi/publish-unit-test-result-action@27d65e188ec43221b20d26de30f4892fad91df2f #v2.22.0

.github/actions/ps-static-code-analysis/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
shell: pwsh
2424
run: |
2525
Set-StrictMode -Version Latest
26-
Invoke-Build -Task Invoke-PSScriptAnalyzer
26+
Invoke-Build -Task PSScriptAnalyzer
2727
2828
- name: Publish Static Code Analysis Results
2929
uses: EnricoMi/publish-unit-test-result-action@27d65e188ec43221b20d26de30f4892fad91df2f #v2.22.0

.github/actions/ps-unit-tests/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ runs:
2323
shell: pwsh
2424
run: |
2525
Set-StrictMode -Version Latest
26-
Invoke-Build -Task Invoke-UnitTests
26+
Invoke-Build -Task UnitTests
2727
2828
- name: Publish Unit Test Results
2929
if: ${{ runner.os == 'Linux' }}

.github/workflows/bootstrap.yml

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,43 @@ jobs:
112112
113113
- name: Update README.md
114114
run: |
115+
OWNER=${{ github.repository_owner }}
115116
MODULE_NAME=${{ github.event.repository.name }}
116117
MODULE_DESCRIPTION="${{ needs.get_repo_state.outputs.description }}"
117118
MODULE_PATH=${{ github.repository }}
118119
rm README.md
119120
mv .github/README_template.md README.md
120121
sed -i "s|PSScriptModule|$MODULE_NAME|g" README.md
122+
sed -i "s|{MODULE_NAME}|$MODULE_NAME|g" README.md
121123
sed -i "s|{MODULE_DESCRIPTION}|$MODULE_DESCRIPTION|g" README.md
122124
sed -i "s|{MODULE_PATH}|$MODULE_PATH|g" README.md
125+
sed -i "s|{OWNER}|$OWNER|g" README.md
123126
124127
- name: Update SUPPORT.md
125128
run: |
126129
MODULE_NAME=${{ github.event.repository.name }}
127-
sed -i "s/PSScriptModule/$MODULE_NAME/g" .githubSUPPORT.md
130+
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/SUPPORT.md
131+
132+
- name: Update SECURITY.md
133+
run: |
134+
MODULE_NAME=${{ github.event.repository.name }}
135+
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/SECURITY.md
136+
137+
- name: Update CONTRIBUTING.md
138+
run: |
139+
MODULE_NAME=${{ github.event.repository.name }}
140+
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/CONTRIBUTING.md
128141
129142
- name: Update LICENSE
130143
run: |
131144
OWNER=${{ github.repository_owner }}
132145
sed -i "s/Warehouse Finds/$OWNER/g" LICENSE
133146
147+
- name: Update CODEOWNERS
148+
run: |
149+
MODULE_NAME=${{ github.event.repository.name }}
150+
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/CODEOWNERS
151+
134152
- name: Remove FUNDING.yml
135153
run: |
136154
rm .github/FUNDING.yml
@@ -145,6 +163,16 @@ jobs:
145163
MODULE_NAME=${{ github.event.repository.name }}
146164
sed -i "s/PSScriptModule/$MODULE_NAME/g" .devcontainer/devcontainer.json
147165
166+
- name: Update copilot-instructions.md
167+
run: |
168+
MODULE_NAME=${{ github.event.repository.name }}
169+
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/copilot-instructions.md
170+
171+
- name: Update getting-started.md
172+
run: |
173+
MODULE_NAME=${{ github.event.repository.name }}
174+
sed -i "s/PSScriptModule/$MODULE_NAME/g" docs/getting-started.md
175+
148176
- name: Update integration test file
149177
run: |
150178
MODULE_NAME=${{ github.event.repository.name }}

.github/workflows/codeQL.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

PSScriptModule.build.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Enter-Build {
3636
}
3737

3838
# Synopsis: Analyze the project with PSScriptAnalyzer
39-
task Invoke-PSScriptAnalyzer {
39+
task PSScriptAnalyzer {
4040
if (-not (Test-Path $testOutputPath)) {
4141
[void] (New-Item -Path $testOutputPath -ItemType Directory)
4242
}
@@ -57,7 +57,7 @@ task Invoke-PSScriptAnalyzer {
5757
}
5858

5959
# Synopsis: Scan the project with Injection Hunter
60-
task Invoke-InjectionHunter {
60+
task InjectionHunter {
6161

6262
$config = New-PesterConfiguration @{
6363
Run = @{
@@ -75,7 +75,7 @@ task Invoke-InjectionHunter {
7575
}
7676

7777
# Synopsis: Run unit tests and generate code coverage report
78-
task Invoke-UnitTests {
78+
task UnitTests {
7979

8080
$container = New-PesterContainer -Path $Script:moduleSourcePath -Data @{ SourcePath = $script:moduleSourcePath }
8181
$config = New-PesterConfiguration @{
@@ -102,7 +102,7 @@ task Invoke-UnitTests {
102102
}
103103

104104
# Synopsis: Run integration tests on built module
105-
task Invoke-IntegrationTests {
105+
task IntegrationTests {
106106
if (-not (Test-Path $testOutputPath)) {
107107
[void] (New-Item -Path $testOutputPath -ItemType Directory)
108108
}
@@ -136,7 +136,7 @@ task Invoke-IntegrationTests {
136136
}
137137

138138
# Synopsis: Run all tests
139-
task Test Invoke-UnitTests, Invoke-PSScriptAnalyzer, Invoke-InjectionHunter
139+
task Test UnitTests, PSScriptAnalyzer, InjectionHunter
140140

141141
# Synopsis: Generate module help documentation
142142
task Export-CommandHelp {

docs/development.md

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -212,9 +212,9 @@ Invoke-Build Build # Compile module
212212
Invoke-Build Test # Run all tests
213213
214214
# Testing tasks
215-
Invoke-Build Invoke-UnitTests # Run Pester tests with coverage
216-
Invoke-Build Invoke-PSScriptAnalyzer # Run static code analysis
217-
Invoke-Build Invoke-InjectionHunter # Run security scans
215+
Invoke-Build UnitTests # Run Pester tests with coverage
216+
Invoke-Build PSScriptAnalyzer # Run static code analysis
217+
Invoke-Build InjectionHunter # Run security scans
218218
219219
# Documentation tasks
220220
Invoke-Build Export-CommandHelp # Generate help files
@@ -274,9 +274,9 @@ Remove-Module YourModuleName
274274
Invoke-Build Test
275275
276276
# Run specific test types
277-
Invoke-Build Invoke-UnitTests # Unit tests only
278-
Invoke-Build Invoke-PSScriptAnalyzer # Code analysis only
279-
Invoke-Build Invoke-InjectionHunter # Security scans only
277+
Invoke-Build UnitTests # Unit tests only
278+
Invoke-Build PSScriptAnalyzer # Code analysis only
279+
Invoke-Build InjectionHunter # Security scans only
280280
281281
# Run specific test file
282282
Invoke-Pester -Path ./src/Public/Get-Something.Tests.ps1
@@ -389,7 +389,7 @@ It 'Should use mocked API call' {
389389

390390
```powershell
391391
# Check coverage
392-
Invoke-Build Invoke-UnitTests
392+
Invoke-Build UnitTests
393393
394394
# Review coverage report
395395
# Open test-results/code-coverage.xml in coverage viewer
@@ -439,9 +439,11 @@ Get-Help Get-Something -Parameter Name
439439

440440
1. **Update comment-based help** in your function
441441
2. **Regenerate help files**:
442+
442443
```powershell
443444
Invoke-Build Export-CommandHelp
444445
```
446+
445447
3. **Review generated markdown** in `docs/help/`
446448
4. **Commit updated documentation**
447449

@@ -468,7 +470,7 @@ All code must pass PSScriptAnalyzer rules:
468470

469471
```powershell
470472
# Run analysis
471-
Invoke-Build Invoke-PSScriptAnalyzer
473+
Invoke-Build PSScriptAnalyzer
472474
473475
# Or directly
474476
Invoke-ScriptAnalyzer -Path ./src -Recurse -Settings ./tests/PSScriptAnalyzer/PSScriptAnalyzerSettings.psd1
@@ -524,9 +526,11 @@ git commit -m "Update README examples +semver: none"
524526
1. **Create feature branch**
525527
2. **Make changes and commit**
526528
3. **Push to GitHub**:
529+
527530
```bash
528531
git push origin feature/my-feature
529532
```
533+
530534
4. **Create Pull Request** on GitHub
531535
5. **Wait for CI checks** to pass:
532536
- Unit tests

0 commit comments

Comments
 (0)