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
11 changes: 10 additions & 1 deletion .github/workflows/Process-PSModule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,15 @@ permissions:

jobs:
Process-PSModule:
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@60bdf8a5a4c92c53fcf2a8d23f7d5f5c93e6864e # v5.4.3
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@d4020f3c9c3621cebae5d8bf4ffaf10f55c1784a # v6.1.2
secrets:
APIKey: ${{ secrets.APIKey }}
TestData: >-
{
"secrets": {
"TEST_SECRET": "${{ secrets.TEST_SECRET }}"
},
"variables": {
"TEST_VARIABLE": "${{ vars.TEST_VARIABLE }}"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
Returns the current date in a custom format like "Monday, January 20, 2026".

.LINK
https://MariusStorhaug.github.io/MariusTestModule/Functions/Get-CurrentDateTime/
https://MariusStorhaug.github.io/MariusTestModule/Functions/DateAndTime/Get-CurrentDateTime/
#>
[OutputType([string])]
[CmdletBinding()]
Expand Down
7 changes: 7 additions & 0 deletions src/functions/public/DateAndTime/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Date and Time

Functions for retrieving and formatting the current date and time.

This section's landing page is provided by an `index.md` file. When Process-PSModule builds the
documentation site, this page becomes the landing page for the **Date and Time** group in the
navigation on GitHub Pages.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
Returns "Good Morning, Alice!" to the user.

.LINK
https://MariusStorhaug.github.io/MariusTestModule/Functions/Get-Greeting/
https://MariusStorhaug.github.io/MariusTestModule/Functions/Greetings/Get-Greeting/
#>
[OutputType([string])]
[CmdletBinding()]
Expand Down
7 changes: 7 additions & 0 deletions src/functions/public/Greetings/Greetings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Greetings

Functions for composing greeting messages.

This section's landing page is provided by a file named after its folder (`Greetings.md`). When
Process-PSModule builds the documentation site, this page becomes the landing page for the
**Greetings** group in the navigation on GitHub Pages.
33 changes: 33 additions & 0 deletions tests/Environment.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSReviewUnusedParameter', '',
Justification = 'Required for Pester tests'
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSUseDeclaredVarsMoreThanAssignments', '',
Justification = 'Required for Pester tests'
)]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
'PSAvoidUsingWriteHost', '',
Justification = 'Deliberately prints the values to the log to demonstrate GitHub Actions masking'
)]
[CmdletBinding()]
param()

Describe 'TestData is pushed into the module tests' {
It 'Exposes the secret from the "secrets" map' {
$actual = [System.Environment]::GetEnvironmentVariable('TEST_SECRET')
$actual | Should -Not -BeNullOrEmpty
$actual | Should -BeExactly 'mariustestmodule-secret-fixture-value'
}

It 'Exposes the variable from the "variables" map' {
$actual = [System.Environment]::GetEnvironmentVariable('TEST_VARIABLE')
$actual | Should -Not -BeNullOrEmpty
$actual | Should -BeExactly 'mariustestmodule-variable-fixture-value'
}

It 'Masks the secret in the log even when a test prints it in plain text' {
Write-Host "Secret in plain text: $env:TEST_SECRET"
Write-Host "Variable in plain text: $env:TEST_VARIABLE"
}
}
Loading