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
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml → .github/workflows/github-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ jobs:

setup:
name: Setup
uses: WarehouseFinds/PSScriptModule/.github/workflows/powershell-script-module-cache-dependencies.yml@main
uses: .github/workflows/ps-resolve-dependencies.yml

unit-tests:
name: Unit Tests
needs: [setup]
uses: WarehouseFinds/PSScriptModule/.github/workflows/powershell-script-module-analysis-unit-tests.yml@main
uses: .github/workflows/ps-analysis-unit-tests.yml
permissions:
issues: write
pull-requests: write
Expand All @@ -53,7 +53,7 @@ jobs:
static-code-analysis:
name: Static Code Analysis
needs: [setup]
uses: WarehouseFinds/PSScriptModule/.github/workflows/powershell-script-module-analysis-static-code.yml@main
uses: .github/workflows/ps-analysis-static-code.yml
permissions:
issues: write
pull-requests: write
Expand All @@ -64,7 +64,7 @@ jobs:
code-injection:
name: Code Injection
needs: [setup]
uses: WarehouseFinds/PSScriptModule/.github/workflows/powershell-script-module-analysis-code-injection.yml@main
uses: .github/workflows/ps-analysis-code-injection.yml
permissions:
issues: write
pull-requests: write
Expand All @@ -75,7 +75,7 @@ jobs:
semantic-code-analysis:
name: Semantic Code Analysis
needs: [setup]
uses: WarehouseFinds/PSScriptModule/.github/workflows/powershell-script-module-analysis-codeQL.yml@main
uses: .github/workflows/ps-analysis-codeQL.yml
permissions:
security-events: write
actions: read
Expand All @@ -85,7 +85,7 @@ jobs:
build:
name: Build
needs: [setup, unit-tests, static-code-analysis, code-injection, semantic-code-analysis]
uses: WarehouseFinds/PSScriptModule/.github/workflows/powershell-script-module-build.yml@main
uses: .github/workflows/ps-build.yml
permissions:
contents: write
with:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ on:
jobs:
setup:
name: Setup
uses: WarehouseFinds/PSScriptModule/.github/workflows/powershell-script-module-cache-dependencies.yml@main
uses: .github/workflows/ps-resolve-dependencies.yml

build:
name: Build
needs: [setup]
uses: WarehouseFinds/PSScriptModule/.github/workflows/powershell-script-module-build.yml@main
uses: .github/workflows/ps-build.yml
permissions:
contents: write
with:
Expand All @@ -42,7 +42,7 @@ jobs:
release:
name: Release
needs: [setup, build]
uses: WarehouseFinds/PSScriptModule/.github/workflows/powershell-script-module-release.yml@main
uses: .github/workflows/ps-release.yml
permissions:
contents: write
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '[template] PS Code Injection Analysis'
name: 'PS Code Injection Analysis'
on:
workflow_call:
inputs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '[template] PS CodeQL Analysis'
name: 'PS CodeQL Analysis'
run-name: "${{ github.event.repository.name }} | PS CodeQL Analysis | ${{ github.run_id }} | ${{ github.event_name }}"
on:
workflow_call:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '[template] PS Static Code Analysis'
name: 'PS Static Code Analysis'
on:
workflow_call:
inputs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '[template] PS Unit Tests'
name: 'PS Unit Tests'
on:
workflow_call:
inputs:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: '[template] PS Build'
name: 'PS Build'
on:
workflow_call:
inputs:
Expand Down
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
"MD033": false,
// MD034 - Bare URL used
"MD034": false,
// MD036 - Emphasis used instead of a heading
"MD036": false,
//MD045 - Multiple consecutive blank lines
"MD045": false,
"no-hard-tabs": true
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

A production-ready PowerShell module template with built-in CI/CD, testing, versioning, and publishing workflows using GitHub Actions.

[![CI](https://github.com/WarehouseFinds/PSScriptModule/actions/workflows/ci.yml/badge.svg)](https://github.com/WarehouseFinds/PSScriptModule/actions/workflows/ci.yml)
[![Code Coverage](https://img.shields.io/github/actions/workflow/status/WarehouseFinds/PSScriptModule/ci.yml?branch=main&label=code%20coverage)](https://github.com/WarehouseFinds/PSScriptModule/actions/workflows/ci.yml)
[![CI](https://github.com/WarehouseFinds/PSScriptModule/actions/workflows/github-ci.yml/badge.svg)](https://github.com/WarehouseFinds/PSScriptModule/actions/workflows/github-ci.yml)
[![Code Coverage](https://img.shields.io/github/actions/workflow/status/WarehouseFinds/PSScriptModule/github-ci.yml?branch=main&label=code%20coverage)](https://github.com/WarehouseFinds/PSScriptModule/actions/workflows/github-ci.yml)
[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/PSScriptModule.svg)](https://www.powershellgallery.com/packages/PSScriptModule)
[![Downloads](https://img.shields.io/powershellgallery/dt/PSScriptModule.svg)](https://www.powershellgallery.com/packages/PSScriptModule)
[![License](https://img.shields.io/github/license/WarehouseFinds/PSScriptModule)](LICENSE)
Expand Down
17 changes: 10 additions & 7 deletions docs/ci-cd.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,13 @@ graph TD
#### 4. Security Scans

**InjectionHunter:**

- Scans for SQL/Command/Script injection vulnerabilities
- Checks for unsafe string concatenation
- Validates input sanitization

**CodeQL:**

- Semantic code analysis
- Detects security vulnerabilities
- Runs weekly scheduled scans
Expand Down Expand Up @@ -97,7 +99,7 @@ For documentation-only changes, the workflow intelligently skips unnecessary job
# CI automatically skips tests for:
- *.md files
- docs/** files
- .github/** workflow files (except changes to ci.yml itself)
- .github/** workflow files (except changes to github-ci.yml itself)
```

## Versioning Strategy
Expand Down Expand Up @@ -127,11 +129,11 @@ Examples:
Add semantic versioning keywords to commit messages:

| Keyword | Version Change | Example | Use Case |
|---------|---------------|---------|----------|
| `+semver: breaking` or `+semver: major` | 1.0.0 → 2.0.0 | Breaking API changes |
| `+semver: feature` or `+semver: minor` | 1.0.0 → 1.1.0 | New features (backward compatible) |
| `+semver: fix` or `+semver: patch` | 1.0.0 → 1.0.1 | Bug fixes |
| `+semver: none` or `+semver: skip` | No change | Documentation updates |
| --------- | --------------- | --------- | ---------- |
| `+semver: breaking` or `+semver: major` | 1.0.0 → 2.0.0 | Breaking API changes | Major release |
| `+semver: feature` or `+semver: minor` | 1.0.0 → 1.1.0 | New features (backward compatible) | Minor release |
| `+semver: fix` or `+semver: patch` | 1.0.0 → 1.0.1 | Bug fixes | Patch release |
| `+semver: none` or `+semver: skip` | No change | Documentation updates | No version bump |

### Commit Message Examples

Expand Down Expand Up @@ -177,7 +179,7 @@ Calculated version: 1.3.0
### Build Types

| Build Context | Version Format | Published | Use Case |
|---------------|---------------|-----------|----------|
| --------------- | --------------- | ----------- | ---------- |
| **Release** | `1.2.3` | ✅ PowerShell Gallery | Production releases |
| **Prerelease** | `1.2.3-alpha.5` | ⚠️ Optional | Testing releases |
| **Debug** | `1.2.3-PullRequest.123` | ❌ Never | Development/PR builds |
Expand Down Expand Up @@ -321,6 +323,7 @@ Manual Workflow Dispatch
The CI workflow automatically creates GitHub Releases:

**On main branch:**

- Creates release with version tag
- Generates release notes from merged PRs
- Attaches module package as artifact
Expand Down
3 changes: 3 additions & 0 deletions src/Public/Get-ModuleMetadata.Tests.ps1
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', '', Justification = 'Variables used in Pester test contexts')]
param()

BeforeAll {
. $PSCommandPath.Replace('.Tests.ps1', '.ps1')

Expand Down