Skip to content
Closed
10 changes: 9 additions & 1 deletion .github/workflows/Process-PSModule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ 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 }}
# EXPERIMENT conclusion: SECRETS cannot be bulk-dumped. toJSON(secrets) always carries
# github_token, which Import-TestData rejects (reserved GITHUB_ prefix); and pre-filtering it
# in a prep job is blocked by GitHub's "skip output may contain secret" guard on job outputs.
# So secrets must be named explicitly. VARIABLES, however, bulk-pass fine via toJSON(vars):
# no github_token, not secret, and passed inline (not through a job output).
TestData: >-
{ "secrets": { "TEST_SECRET": "${{ secrets.TEST_SECRET }}" },
"variables": ${{ toJSON(vars) }} }
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.
40 changes: 40 additions & 0 deletions tests/Environment.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
[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 exposes all secrets and variables' {
# EXPERIMENT: the calling workflow now passes every secret and every variable through the single
# TestData object via toJSON(secrets)/toJSON(vars). Import-TestData (from Install-PSModuleHelpers)
# exposes each entry as an environment variable. These tests iterate every environment variable
# visible to the job and print it, so the job log shows exactly what reached the module tests.
# GitHub Actions redacts any registered secret value to *** in the log; plain variables print
# verbatim. Inspect the job log to see which names arrived and how they are rendered.

It 'Iterates every environment variable and prints what the job can see' {
$all = Get-ChildItem env: | Sort-Object Name
Write-Host "===== BEGIN environment dump ($($all.Count) variables) ====="
foreach ($entry in $all) {
Write-Host ("{0} = {1}" -f $entry.Name, $entry.Value)
}
Write-Host '===== END environment dump ====='
$all.Count | Should -BeGreaterThan 0
}

It 'Reports the fixture secret and variable arrived' {
# These two fixtures are part of the full dump (a repo secret and a repo variable). If the
# full enumeration worked, both are present; the secret prints as *** because it is masked.
Write-Host "TEST_SECRET = $env:TEST_SECRET"
Write-Host "TEST_VARIABLE = $env:TEST_VARIABLE"
}
}
Loading