Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
366 changes: 25 additions & 341 deletions .github/README_template.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/actions/ps-code-injection/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
shell: pwsh
run: |
Set-StrictMode -Version Latest
Invoke-Build -Task Invoke-InjectionHunter
Invoke-Build -Task InjectionHunter

- name: Publish Code Injection Analysis Results
uses: EnricoMi/publish-unit-test-result-action@27d65e188ec43221b20d26de30f4892fad91df2f #v2.22.0
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/ps-static-code-analysis/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
shell: pwsh
run: |
Set-StrictMode -Version Latest
Invoke-Build -Task Invoke-PSScriptAnalyzer
Invoke-Build -Task PSScriptAnalyzer

- name: Publish Static Code Analysis Results
uses: EnricoMi/publish-unit-test-result-action@27d65e188ec43221b20d26de30f4892fad91df2f #v2.22.0
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/ps-unit-tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
shell: pwsh
run: |
Set-StrictMode -Version Latest
Invoke-Build -Task Invoke-UnitTests
Invoke-Build -Task UnitTests

- name: Publish Unit Test Results
if: ${{ runner.os == 'Linux' }}
Expand Down
30 changes: 29 additions & 1 deletion .github/workflows/bootstrap.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,25 +112,43 @@ jobs:

- name: Update README.md
run: |
OWNER=${{ github.repository_owner }}
MODULE_NAME=${{ github.event.repository.name }}
MODULE_DESCRIPTION="${{ needs.get_repo_state.outputs.description }}"
MODULE_PATH=${{ github.repository }}
rm README.md
mv .github/README_template.md README.md
sed -i "s|PSScriptModule|$MODULE_NAME|g" README.md
sed -i "s|{MODULE_NAME}|$MODULE_NAME|g" README.md
sed -i "s|{MODULE_DESCRIPTION}|$MODULE_DESCRIPTION|g" README.md
sed -i "s|{MODULE_PATH}|$MODULE_PATH|g" README.md
sed -i "s|{OWNER}|$OWNER|g" README.md

- name: Update SUPPORT.md
run: |
MODULE_NAME=${{ github.event.repository.name }}
sed -i "s/PSScriptModule/$MODULE_NAME/g" .githubSUPPORT.md
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/SUPPORT.md

- name: Update SECURITY.md
run: |
MODULE_NAME=${{ github.event.repository.name }}
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/SECURITY.md

- name: Update CONTRIBUTING.md
run: |
MODULE_NAME=${{ github.event.repository.name }}
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/CONTRIBUTING.md

- name: Update LICENSE
run: |
OWNER=${{ github.repository_owner }}
sed -i "s/Warehouse Finds/$OWNER/g" LICENSE

- name: Update CODEOWNERS
run: |
MODULE_NAME=${{ github.event.repository.name }}
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/CODEOWNERS

- name: Remove FUNDING.yml
run: |
rm .github/FUNDING.yml
Expand All @@ -145,6 +163,16 @@ jobs:
MODULE_NAME=${{ github.event.repository.name }}
sed -i "s/PSScriptModule/$MODULE_NAME/g" .devcontainer/devcontainer.json

- name: Update copilot-instructions.md
run: |
MODULE_NAME=${{ github.event.repository.name }}
sed -i "s/PSScriptModule/$MODULE_NAME/g" .github/copilot-instructions.md

- name: Update getting-started.md
run: |
MODULE_NAME=${{ github.event.repository.name }}
sed -i "s/PSScriptModule/$MODULE_NAME/g" docs/getting-started.md

- name: Update integration test file
run: |
MODULE_NAME=${{ github.event.repository.name }}
Expand Down
28 changes: 0 additions & 28 deletions .github/workflows/codeQL.yml

This file was deleted.

10 changes: 5 additions & 5 deletions PSScriptModule.build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Enter-Build {
}

# Synopsis: Analyze the project with PSScriptAnalyzer
task Invoke-PSScriptAnalyzer {
task PSScriptAnalyzer {
if (-not (Test-Path $testOutputPath)) {
[void] (New-Item -Path $testOutputPath -ItemType Directory)
}
Expand All @@ -57,7 +57,7 @@ task Invoke-PSScriptAnalyzer {
}

# Synopsis: Scan the project with Injection Hunter
task Invoke-InjectionHunter {
task InjectionHunter {

$config = New-PesterConfiguration @{
Run = @{
Expand All @@ -75,7 +75,7 @@ task Invoke-InjectionHunter {
}

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

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

# Synopsis: Run integration tests on built module
task Invoke-IntegrationTests {
task IntegrationTests {
if (-not (Test-Path $testOutputPath)) {
[void] (New-Item -Path $testOutputPath -ItemType Directory)
}
Expand Down Expand Up @@ -136,7 +136,7 @@ task Invoke-IntegrationTests {
}

# Synopsis: Run all tests
task Test Invoke-UnitTests, Invoke-PSScriptAnalyzer, Invoke-InjectionHunter
task Test UnitTests, PSScriptAnalyzer, InjectionHunter

# Synopsis: Generate module help documentation
task Export-CommandHelp {
Expand Down
20 changes: 12 additions & 8 deletions docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,9 @@ Invoke-Build Build # Compile module
Invoke-Build Test # Run all tests

# Testing tasks
Invoke-Build Invoke-UnitTests # Run Pester tests with coverage
Invoke-Build Invoke-PSScriptAnalyzer # Run static code analysis
Invoke-Build Invoke-InjectionHunter # Run security scans
Invoke-Build UnitTests # Run Pester tests with coverage
Invoke-Build PSScriptAnalyzer # Run static code analysis
Invoke-Build InjectionHunter # Run security scans

# Documentation tasks
Invoke-Build Export-CommandHelp # Generate help files
Expand Down Expand Up @@ -274,9 +274,9 @@ Remove-Module YourModuleName
Invoke-Build Test

# Run specific test types
Invoke-Build Invoke-UnitTests # Unit tests only
Invoke-Build Invoke-PSScriptAnalyzer # Code analysis only
Invoke-Build Invoke-InjectionHunter # Security scans only
Invoke-Build UnitTests # Unit tests only
Invoke-Build PSScriptAnalyzer # Code analysis only
Invoke-Build InjectionHunter # Security scans only

# Run specific test file
Invoke-Pester -Path ./src/Public/Get-Something.Tests.ps1
Expand Down Expand Up @@ -389,7 +389,7 @@ It 'Should use mocked API call' {

```powershell
# Check coverage
Invoke-Build Invoke-UnitTests
Invoke-Build UnitTests

# Review coverage report
# Open test-results/code-coverage.xml in coverage viewer
Expand Down Expand Up @@ -439,9 +439,11 @@ Get-Help Get-Something -Parameter Name

1. **Update comment-based help** in your function
2. **Regenerate help files**:

```powershell
Invoke-Build Export-CommandHelp
```

3. **Review generated markdown** in `docs/help/`
4. **Commit updated documentation**

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

```powershell
# Run analysis
Invoke-Build Invoke-PSScriptAnalyzer
Invoke-Build PSScriptAnalyzer

# Or directly
Invoke-ScriptAnalyzer -Path ./src -Recurse -Settings ./tests/PSScriptAnalyzer/PSScriptAnalyzerSettings.psd1
Expand Down Expand Up @@ -524,9 +526,11 @@ git commit -m "Update README examples +semver: none"
1. **Create feature branch**
2. **Make changes and commit**
3. **Push to GitHub**:

```bash
git push origin feature/my-feature
```

4. **Create Pull Request** on GitHub
5. **Wait for CI checks** to pass:
- Unit tests
Expand Down
Loading