Skip to content

Commit 0e34e22

Browse files
Align module setup guidance with repository standard
Document the baseline, required workflow credentials, supported site configuration, and exact caller contract consistently across setup and reference guides. Co-authored-by: Copilot <223556698+Copilot@users.noreply.github.com>
1 parent 153529e commit 0e34e22

9 files changed

Lines changed: 95 additions & 83 deletions

File tree

docs/content/get-started/index.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,28 @@ Start new modules from the PSModule template repository:
1111
## Quickstart
1212

1313
1. [Create a new repository from the template](https://github.com/new?template_name=Template-PSModule&template_owner=PSModule&description=Add%20a%20description%20(required)&name=%3CModule%20name%3E).
14-
2. [Configure the repository](repository-setup.md) — GitHub Pages, `PSGALLERY_API_KEY`, and the caller workflow.
15-
3. Replace placeholder metadata and remove scaffold sample files.
14+
2. Complete the [module repository baseline](repository-setup.md#1-complete-the-module-repository-baseline): replace
15+
template tokens, remove scaffolding, set `Type: Module`, and confirm required files.
16+
3. [Configure the repository](repository-setup.md) — GitHub Pages, workflow secrets, the caller workflow, settings, and
17+
Zensical.
1618
4. Add your first public command and tests.
17-
5. Validate `.github/PSModule.yml` defaults for your module.
18-
6. [Open a draft pull request](your-first-release.md), then release from its resulting important default-branch push.
19+
5. [Open a draft pull request](your-first-release.md), then release from its resulting important default-branch push.
1920

2021
If the module needs several interdependent commands before it is usable at all, see
2122
[Module bootstrap](module-bootstrap.md) instead of shipping them as one command per step.
2223

2324
## Expected outcomes
2425

25-
- The repository follows the [expected structure](../guides/structuring-your-module.md).
26+
- The repository follows the [repository standard](../reference/repository-standard.md) and
27+
[expected structure](../guides/structuring-your-module.md).
2628
- The module can be built and tested in CI.
2729
- The release strategy is ready when functionality is implemented.
2830

2931
## In this section
3032

3133
| Page | Description |
3234
| --- | --- |
33-
| [Repository setup](repository-setup.md) | GitHub Pages, `PSGALLERY_API_KEY`, permissions, and the caller workflow. |
35+
| [Repository setup](repository-setup.md) | Repository baseline, GitHub Pages, workflow secrets, and the caller workflow. |
3436
| [Your first release](your-first-release.md) | The pull request flow, version labels, and the resulting default-branch release. |
3537
| [Module bootstrap](module-bootstrap.md) | Getting a brand-new module to its first release with an integration branch. |
3638

docs/content/get-started/repository-setup.md

Lines changed: 35 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,23 @@ description: Configure GitHub Pages, `PSGALLERY_API_KEY`, permissions, and the c
66
# Repository setup
77

88
Do this once per module repository, after creating it from
9-
[Template-PSModule](https://github.com/PSModule/Template-PSModule).
9+
[Template-PSModule](https://github.com/PSModule/Template-PSModule). The template supplies the initial repository
10+
files and framework wiring; this guide verifies the standard baseline and configures its external services.
1011

11-
## 1. Enable GitHub Pages
12+
## 1. Complete the module repository baseline
13+
14+
Before configuring the pipeline:
15+
16+
1. Replace every template token, including the README and `.github/zensical.toml`.
17+
2. Remove scaffold functions, tests, and examples that do not belong to the module.
18+
3. Set the repository description and its `Type` custom property to `Module`; retain `main` as the default branch.
19+
4. Confirm the required community, governance, agent, dependency-update, and workflow files are present.
20+
5. Confirm the README follows the module start-page requirements, including `Install-PSResource` installation guidance.
21+
6. Keep `.github/PSModule.yml` limited to settings that override the framework defaults.
22+
23+
[Repository standard](../reference/repository-standard.md) defines the required files, metadata, and README shape.
24+
25+
## 2. Enable GitHub Pages
1226

1327
Enable GitHub Pages in the repository settings and set it to deploy from **GitHub Actions**.
1428

@@ -18,18 +32,23 @@ This creates an environment called `github-pages` that GitHub deploys the docume
1832
<img src="../media/pagesEnvironment.png" alt="Remove the branch protection on main">
1933
</details>
2034

21-
## 2. Create `PSGALLERY_API_KEY`
35+
## 3. Configure workflow secrets
36+
37+
Create these repository or organization Actions secrets:
2238

23-
1. [Create an API key on the PowerShell Gallery](https://www.powershellgallery.com/account/apikeys). Give it permission
24-
to manage the module you are working on.
25-
2. Create a repository or organization secret called `PSGALLERY_API_KEY` and set the API key as its value.
39+
| Secret | Purpose |
40+
| --- | --- |
41+
| `PSGALLERY_API_KEY` | An [API key](https://www.powershellgallery.com/account/apikeys) authorized to manage the module on the PowerShell Gallery. |
42+
| `SHELLY_CLIENT_ID` | The GitHub App client ID that the caller maps to `GitHubAppClientId`. |
43+
| `SHELLY_PRIVATE_KEY` | The GitHub App private key that the caller maps to `GitHubAppPrivateKey`. |
2644

27-
If you plan to create many modules, use a glob pattern for the API key permissions in the PowerShell Gallery and store
28-
`PSGALLERY_API_KEY` on the organization instead of on each repository.
45+
Use a glob pattern for PowerShell Gallery API-key permissions and store `PSGALLERY_API_KEY` at the organization level
46+
when several modules share it. For Dependabot pull requests, add all three secrets to the Dependabot secret store.
47+
[GitHub App authentication](../guides/github-app-authentication.md) defines the App permissions and token boundaries.
2948

30-
## 3. Add the caller workflow
49+
## 4. Verify the caller workflow
3150

32-
Create `.github/workflows/Process-PSModule.yml` in the module repository:
51+
The template supplies `.github/workflows/Process-PSModule.yml`. Replace the caller with this standard form:
3352

3453
```yaml
3554
name: Process-PSModule
@@ -96,9 +115,10 @@ cancels obsolete activity and uses the pull-request number for every action, inc
96115
literal queue value and does not permit cancellation with `queue: max`, so the two jobs use separate compatible
97116
policies. Keep both groups distinct from the reusable workflow's prefixed group.
98117

99-
## 4. Add the settings file
118+
## 5. Configure the settings file
100119

101-
Create `.github/PSModule.yml`. An empty file is valid — every setting has a default:
120+
The template supplies `.github/PSModule.yml`. Keep only the overrides the module needs; an empty file is valid when a
121+
hand-built repository needs no overrides:
102122

103123
```yaml
104124
Name: null
@@ -107,10 +127,10 @@ Name: null
107127
See [Settings](../reference/settings.md) for the full contract and
108128
[Configuring the pipeline](../guides/configuring-the-pipeline.md) for worked examples.
109129

110-
## 5. Configure the documentation site
130+
## 6. Configure the documentation site
111131

112-
Process-PSModule builds documentation with [Zensical](https://zensical.org/) from `.github/zensical.toml`. The template
113-
ships a working file; update the site name and repository links to match the module.
132+
The template builds documentation with [Zensical](https://zensical.org/) from `.github/zensical.toml`. Replace each
133+
template token with the module's name, owner, and repository URL.
114134

115135
## Next
116136

docs/content/guides/calling-the-workflow.md

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ description: How to call the Process-PSModule reusable workflow — the caller w
55

66
# Calling the workflow
77

8-
To use the workflow, create a new file in the `.github/workflows` directory of the module repository and add the following content.
9-
For documentation site generation, use `zensical.toml` as the active site contract.
8+
Template-PSModule supplies a starter `.github/workflows/Process-PSModule.yml`. Replace it with this standard
9+
template; repositories created without the template create the file with this content. The template's documentation
10+
contract uses `.github/zensical.toml`.
1011

1112
For the exact inputs, secrets, and permissions the reusable workflow declares, see
1213
[Workflow inputs](../reference/workflow-inputs.md).
@@ -35,8 +36,6 @@ on:
3536
- labeled
3637
- unlabeled
3738

38-
permissions: {}
39-
4039
jobs:
4140
Process-PSModule-Production:
4241
if: ${{ github.event_name != 'pull_request' }}
@@ -230,28 +229,8 @@ settings file:
230229
ImportantFilePatterns: []
231230
```
232231

233-
You can also pass patterns via the workflow input:
234-
235-
```yaml
236-
jobs:
237-
Process:
238-
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v8
239-
with:
240-
ImportantFilePatterns: |
241-
^src/
242-
^README\.md$
243-
^examples/
244-
```
245-
246-
To disable triggering via the workflow input, pass an explicit empty string:
247-
248-
```yaml
249-
jobs:
250-
process:
251-
uses: PSModule/Process-PSModule/.github/workflows/workflow.yml@v8
252-
with:
253-
ImportantFilePatterns: ''
254-
```
232+
The standard caller does not add `with:` overrides. Configure
233+
`ImportantFilePatterns` in `.github/PSModule.yml`.
255234

256235
Note that omitting the `ImportantFilePatterns` key entirely causes the workflow's default patterns (`^src/` and
257236
`^README\.md$`) to be used. The settings file takes priority over the workflow input, so set

docs/content/guides/github-app-authentication.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ installation tokens. These workflows do not use `github.token` as a fallback for
1010

1111
## Caller secret contract
1212

13-
The reusable workflow declares two required secrets at its `workflow_call` boundary:
13+
The reusable workflow declares three required secrets at its `workflow_call` boundary:
1414

1515
| Name | Purpose |
1616
| --- | --- |
17+
| `PSGALLERY_API_KEY` | The API key that publishes the module to the PowerShell Gallery. |
1718
| `GitHubAppClientId` | The GitHub App client ID passed to the token action. |
1819
| `GitHubAppPrivateKey` | The GitHub App private key passed to the token action. |
1920

@@ -37,13 +38,13 @@ jobs:
3738
GitHubAppPrivateKey: ${{ secrets.SHELLY_PRIVATE_KEY }}
3839
```
3940
40-
The root reusable workflow forwards these two values to the Plan, Build-Module, and Publish-Module reusable jobs.
41-
Do not use `secrets: inherit` as a substitute for this mapping.
41+
The root reusable workflow forwards the GitHub App credentials to the Plan, Build-Module, and Publish-Module reusable
42+
jobs, and passes the Gallery API key to publication. Do not use `secrets: inherit` as a substitute for this mapping.
4243

4344
Dependabot-triggered workflows cannot read regular Actions secrets. To run Process-PSModule on Dependabot pull
44-
requests, create `SHELLY_CLIENT_ID` and `SHELLY_PRIVATE_KEY` as Dependabot secrets in addition to Actions secrets.
45-
This is a deliberate trust boundary: review the App's installation scope and every dependency update carefully,
46-
because the workflow can mint a Shelly token before human review.
45+
requests, create `PSGALLERY_API_KEY`, `SHELLY_CLIENT_ID`, and `SHELLY_PRIVATE_KEY` as Dependabot secrets in addition
46+
to Actions secrets. This is a deliberate trust boundary: review the App's installation scope and every dependency
47+
update carefully, because the workflow can mint a Shelly token before human review.
4748

4849
## GitHub App installation permissions
4950

docs/content/guides/structuring-your-module.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The goal is a stable repository anatomy so both humans and automation know exact
2727

2828
```plaintext
2929
<ModuleName>/
30-
├── .github/ # Workflow config, doc/site templates, automation policy
30+
├── .github/ # Workflow config, site template, and automation policy
3131
│ ├── linters/ # Rule sets applied by shared lint steps
3232
│ │ ├── .markdown-lint.yml # Markdown rules enforced via super-linter
3333
│ │ ├── .powershell-psscriptanalyzer.psd1 # Analyzer profile for test jobs
@@ -36,22 +36,29 @@ The goal is a stable repository anatomy so both humans and automation know exact
3636
│ │ └── Process-PSModule.yml # Consumer hook into this workflow bundle
3737
│ ├── CODEOWNERS # Default reviewers enforced by Process-PSModule checks
3838
│ ├── dependabot.yml # Dependency update cadence handled by GitHub
39-
│ ├── zensical.toml # Site config consumed during site builds
4039
│ ├── PSModule.yml # Settings parsed to drive matrices
41-
│ └── release.yml # Release automation template invoked on publish
40+
│ ├── pull_request_template.md # PR description structure
41+
│ ├── release.yml # Release automation template invoked on publish
42+
│ └── zensical.toml # Site config consumed during site builds
43+
├── AGENTS.md # Agent entry point
44+
├── CLAUDE.md # Claude Code route to AGENTS.md
45+
├── CODE_OF_CONDUCT.md # Community conduct expectations
46+
├── CONTRIBUTING.md # Repository contribution guidance
4247
├── examples/ # Samples referenced in generated documentation
4348
│ └── General.ps1 # Example script processed by Process-PSModule
4449
├── icon/ # Icon assets linked from manifest and documentation
4550
│ └── icon.png # Default module icon (PNG format)
51+
├── LICENSE # Reuse terms
52+
├── README.md # Module landing page rendered on GitHub and docs
53+
├── SECURITY.md # Security reporting policy
4654
├── src/ # Module source, see "Module source code structure" below
4755
├── tests/ # Pester suites; the Simple layout is shown
4856
│ ├── AfterAll.ps1 (optional) # Cleanup script for ModuleLocal runs
4957
│ ├── BeforeAll.ps1 (optional) # Setup script for ModuleLocal runs
5058
│ └── <ModuleName>.Tests.ps1 # Simple: one root-level module suite
5159
├── .gitattributes # Normalizes line endings across platforms
5260
├── .gitignore # Excludes build artifacts from source control
53-
├── LICENSE # License text surfaced in manifest metadata
54-
└── README.md # Repository overview rendered on GitHub and docs landing
61+
└── SUPPORT.md # Support expectations
5562
```
5663

5764
The tree shows the [Simple PowerShell test profile](https://msx.no/docs/Coding-Standards/PowerShell/Testing/#simple), not an exclusive test-file shape. Standard keeps one root-level `tests/<Group>.Tests.ps1` file per public function group. Advanced uses recursively discovered subdirectories, and layouts may mix across directories. Process-PSModule defines the exact [per-directory precedence and sibling suppression](writing-module-tests.md#test-discovery).

docs/content/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ New to Process-PSModule? Work through these in order.
2626
| Page | Description |
2727
| --- | --- |
2828
| [Get started](get-started/index.md) | Create a module repository from the template and get the pipeline running. |
29-
| [Repository setup](get-started/repository-setup.md) | Configure GitHub Pages, `PSGALLERY_API_KEY`, permissions, and the caller workflow. |
29+
| [Repository setup](get-started/repository-setup.md) | Repository baseline, GitHub Pages, workflow secrets, and the caller workflow. |
3030
| [Your first release](get-started/your-first-release.md) | The pull request flow, version labels, and the resulting default-branch release. |
3131

3232
## Guides

0 commit comments

Comments
 (0)