Skip to content

Commit ed2a4f5

Browse files
Merge pull request #124 from WarehouseFinds/fix/integration-tests
Enhance documentation templates
2 parents 710d7d9 + c7b9236 commit ed2a4f5

File tree

8 files changed

+68
-13
lines changed

8 files changed

+68
-13
lines changed
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@
77
[![Downloads](https://img.shields.io/powershellgallery/dt/{MODULE_NAME}.svg)](https://www.powershellgallery.com/packages/{MODULE_NAME})
88
[![License](https://img.shields.io/github/license/{MODULE_PATH})](LICENSE)
99

10+
## About
11+
12+
{MODULE_NAME} is a PowerShell module that {BRIEF_MODULE_PURPOSE}. It aims to {MODULE_GOALS_OR_OBJECTIVES}.
13+
14+
## Why {MODULE_NAME}?
15+
16+
{MODULE_NAME} is designed to {BRIEF_MODULE_PURPOSE}. It simplifies {SPECIFIC_TASKS_OR_PROCESSES} by providing {KEY_BENEFITS_OR_FEATURES}.
17+
1018
## 🚀 Getting Started
1119

1220
### Prerequisites
@@ -36,8 +44,8 @@ Get-Command -Module {MODULE_NAME}
3644

3745
Comprehensive documentation is available in the [`docs/`](docs/) directory:
3846

47+
- 🚀 **[Getting Started](docs/getting-started.md)** - Practical examples and usage scenarios
3948
- 📘 **[Module Help](docs/)** - Help files for cmdlets and functions
40-
- 🚀 **[Examples](docs/examples/)** - Practical examples and usage scenarios
4149

4250
## 🤝 Contributing
4351

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# {MODULE_NAME} Usage Guide
2+
3+
## Overview
4+
5+
{MODULE_DESCRIPTION}
6+
7+
## Key Features
8+
9+
## Core Functions
10+
11+
## Complete Workflow Example
12+
13+
## Pipeline Examples
14+
15+
## Error Handling
16+
17+
## Best Practices
18+
19+
## Security Considerations
20+
21+
## Troubleshooting
22+
23+
## Resources

.github/actions/ps-build/action.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,5 +95,6 @@ runs:
9595
fi
9696
git config user.name "github-actions[bot]"
9797
git config user.email "github-actions[bot]@users.noreply.github.com"
98+
git config push.autoSetupRemote true
9899
git commit -m "Update PowerShell help for release v${{ steps.gitversion.outputs.majorMinorPatch }}"
99-
git push origin HEAD:main
100+
git push

.github/actions/ps-release/action.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ inputs:
1010
publish-psgallery:
1111
description: Publish to PowerShell Gallery
1212
required: true
13+
secrets:
14+
PSGALLERY_API_KEY:
15+
description: API Key for PowerShell Gallery
16+
required: false
1317
runs:
1418
using: composite
1519
steps:
@@ -20,12 +24,16 @@ runs:
2024
GITHUB_TOKEN: ${{ github.token }}
2125
run: |
2226
git fetch --tags
23-
$previousTag = (git tag --sort=-v:refname)[0]
27+
$tags = @(git tag --sort=-v:refname)
28+
$previousTag = if ($tags.Count -gt 0) { $tags[0] } else { $null }
2429
$uri = "https://api.github.com/repos/${{ github.repository }}/releases/generate-notes"
2530
$body = @{
2631
tag_name = "v${{ inputs.release-version }}"
2732
target_commitish = "main"
28-
previous_tag_name = $previousTag
33+
}
34+
# Only include previous_tag_name if a previous tag exists
35+
if ($previousTag) {
36+
$body['previous_tag_name'] = $previousTag
2937
}
3038
$requestParams = @{
3139
Method = 'Post'
@@ -54,8 +62,6 @@ runs:
5462
- name: Publish build package to PSGallery
5563
if: ${{ inputs.publish-psgallery == 'true' && env.PSGALLERY_API_KEY != '' }}
5664
shell: pwsh
57-
env:
58-
PSGALLERY_API_KEY: ${{ env.PSGALLERY_API_KEY }}
5965
run: |
6066
Set-StrictMode -Version Latest
6167
[void] (Import-Module InvokeBuild)

.github/workflows/bootstrap.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ jobs:
116116
MODULE_DESCRIPTION="${{ needs.get_repo_state.outputs.description }}"
117117
MODULE_PATH=${{ github.repository }}
118118
rm README.md
119-
mv .github/README_template.md README.md
119+
mv .github/DOCS_TEMPLATE/README_template.md README.md
120120
sed -i "s|PSScriptModule|$MODULE_NAME|g" README.md
121121
sed -i "s|{MODULE_NAME}|$MODULE_NAME|g" README.md
122122
sed -i "s|{MODULE_DESCRIPTION}|$MODULE_DESCRIPTION|g" README.md
@@ -169,8 +169,12 @@ jobs:
169169
170170
- name: Update getting-started.md
171171
run: |
172+
rm docs/getting-started.md
173+
mv .github/DOCS_TEMPLATE/getting-started_template.md docs/getting-started.md
172174
MODULE_NAME=${{ github.event.repository.name }}
173-
sed -i "s/PSScriptModule/$MODULE_NAME/g" docs/getting-started.md
175+
MODULE_DESCRIPTION="${{ needs.get_repo_state.outputs.description }}"
176+
sed -i "s/{MODULE_NAME}/$MODULE_NAME/g" docs/getting-started.md
177+
sed -i "s/{MODULE_DESCRIPTION}/$MODULE_DESCRIPTION/g" docs/getting-started.md
174178
175179
- name: Update integration test file
176180
run: |

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,18 @@ on:
2626
- '*.psd1'
2727

2828
jobs:
29+
changes:
30+
name: Label Changes
31+
runs-on: [ubuntu-latest]
32+
if: github.event_name == 'pull_request'
33+
permissions:
34+
contents: read
35+
pull-requests: write
36+
steps:
37+
- name: Labeler
38+
id: labeler
39+
uses: actions/labeler@634933edcd8ababfe52f92936142cc22ac488b1b #v6.0.1
40+
2941
dependencies:
3042
name: Dependencies
3143
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,28 @@ jobs:
2525
runs-on: ubuntu-latest
2626
permissions:
2727
contents: write
28-
env:
29-
PSGALLERY_API_KEY: ${{ secrets.PSGALLERY_API_KEY }}
3028
steps:
3129
- name: Checkout repository
3230
uses: actions/checkout@v6
3331
with:
3432
repository: ${{ github.repository }}
3533
fetch-depth: 0
34+
3635
- name: Resolve dependencies
3736
id: resolve
3837
uses: ./.github/actions/ps-resolve-dependencies
38+
3939
- name: Build Module
4040
id: build
4141
uses: ./.github/actions/ps-build
4242
with:
4343
release-type: ${{ inputs['release-type'] }}
4444
module-list: ${{ steps.resolve.outputs.module-list }}
45+
4546
- name: Release Module
4647
uses: ./.github/actions/ps-release
48+
env:
49+
PSGALLERY_API_KEY: ${{ secrets.NUGETAPIKEY_PSGALLERY }}
4750
with:
48-
release-type: ${{ inputs['release-type'] }}
4951
release-version: ${{ steps.build.outputs.release-version }}
50-
module-list: ${{ steps.resolve.outputs.module-list }}
5152
publish-psgallery: ${{ inputs.publish-psgallery }}

tests/Integration/Module.Integration.Tests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Describe 'PSScriptModule Integration Tests' -Tag 'Integration' {
6161
}
6262

6363
It 'Public function files' {
64-
$publicFunctionFiles | Should -HaveCount 1 -Because 'The template ships with a single public function'
64+
$publicFunctionFiles.Count | Should -BeGreaterThan 0
6565
}
6666

6767
It 'Should discover public functions from src/Public' {

0 commit comments

Comments
 (0)