You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`Name`|`string`| The name of the module to process. This defaults to the repository name if nothing is specified. |`false`| N/A |
114
+
|`SettingsPath`|`string`| The path to the settings file. Settings in the settings file take precedence over the action inputs. |`false`|`.github/PSModule.yml`|
115
+
|`Version`|`string`| Specifies the version of the GitHub module to be installed. The value must be an exact version. |`false`|`''`|
116
+
|`Prerelease`|`boolean`| Whether to use a prerelease version of the 'GitHub' module. |`false`|`false`|
117
+
|`Debug`|`boolean`| Whether to enable debug output. Adds a `debug` step to every job. |`false`|`false`|
118
+
|`Verbose`|`boolean`| Whether to enable verbose output. |`false`|`false`|
119
+
|`WorkingDirectory`|`string`| The path to the root of the repo. |`false`|`.`|
120
+
121
+
### Setup and Teardown Scripts
122
+
123
+
The workflow supports automatic execution of setup and teardown scripts for module tests:
124
+
125
+
- Scripts are automatically detected and executed if present
126
+
- If no scripts are found, the workflow continues normally
127
+
128
+
#### Setup - `BeforeAll.ps1`
129
+
130
+
- Place in your test directories (`tests/BeforeAll.ps1`)
131
+
- Runs once before all test matrix jobs to prepare the test environment
132
+
- Deploy test infrastructure, download test data, initialize databases, or configure services
133
+
- Has access to the same environment variables as your tests (secrets, GitHub token, etc.)
134
+
135
+
##### Example - `BeforeAll.ps1`
136
+
137
+
```powershell
138
+
Write-Host "Setting up test environment..."
139
+
# Deploy test infrastructure
140
+
# Download test data
141
+
# Initialize test databases
142
+
Write-Host "Test environment ready!"
143
+
```
144
+
145
+
#### Teardown - `AfterAll.ps1`
146
+
147
+
- Place in your test directories (`tests/AfterAll.ps1`)
148
+
- Runs once after all test matrix jobs complete to clean up the test environment
149
+
- Remove test resources, clean up databases, stop services, or upload artifacts
150
+
- Has access to the same environment variables as your tests
151
+
152
+
##### Example - `AfterAll.ps1`
153
+
154
+
```powershell
155
+
Write-Host "Cleaning up test environment..."
156
+
# Remove test resources
157
+
# Cleanup databases
158
+
# Stop services
159
+
Write-Host "Cleanup completed!"
160
+
```
161
+
162
+
### Secrets
163
+
164
+
The following secrets are used by the workflow. They can be automatically provided (if available) by setting the `secrets: inherit`
165
+
in the workflow file.
166
+
167
+
| Name | Location | Description | Default |
168
+
| ---- | -------- | ----------- | ------- |
169
+
|`APIKEY`| GitHub secrets | The API key for the PowerShell Gallery. | N/A |
170
+
|`TEST_APP_ENT_CLIENT_ID`| GitHub secrets | The client ID of an Enterprise GitHub App for running tests. | N/A |
171
+
|`TEST_APP_ENT_PRIVATE_KEY`| GitHub secrets | The private key of an Enterprise GitHub App for running tests. | N/A |
172
+
|`TEST_APP_ORG_CLIENT_ID`| GitHub secrets | The client ID of an Organization GitHub App for running tests. | N/A |
173
+
|`TEST_APP_ORG_PRIVATE_KEY`| GitHub secrets | The private key of an Organization GitHub App for running tests. | N/A |
174
+
|`TEST_USER_ORG_FG_PAT`| GitHub secrets | The fine-grained personal access token with org access for running tests. | N/A |
175
+
|`TEST_USER_USER_FG_PAT`| GitHub secrets | The fine-grained personal access token with user account access for running tests. | N/A |
176
+
|`TEST_USER_PAT`| GitHub secrets | The classic personal access token for running tests. | N/A |
177
+
178
+
### Permissions
179
+
180
+
The following permissions are needed for the workflow to be able to perform all tasks.
181
+
182
+
```yaml
183
+
permissions:
184
+
contents: write # to checkout the repo and create releases on the repo
185
+
pull-requests: write # to write comments to PRs
186
+
statuses: write # to update the status of the workflow from linter
187
+
pages: write # to deploy to Pages
188
+
id-token: write # to verify the Pages deployment originates from an appropriate source
189
+
```
190
+
191
+
For more info see [Deploy GitHub Pages site](https://github.com/marketplace/actions/deploy-github-pages-site).
192
+
193
+
### Scenario Matrix
194
+
195
+
This table shows when each job runs based on the trigger scenario:
| `Name` | `string` | The name of the module to process. This defaults to the repository name if nothing is specified. | `false` | N/A |
289
-
| `SettingsPath` | `string` | The path to the settings file. Settings in the settings file take precedence over the action inputs. | `false` | `.github/PSModule.yml` |
290
-
| `Version` | `string` | Specifies the version of the GitHub module to be installed. The value must be an exact version. | `false` | `''` |
291
-
| `Prerelease` | `boolean` | Whether to use a prerelease version of the 'GitHub' module. | `false` | `false` |
292
-
| `Debug` | `boolean` | Whether to enable debug output. Adds a `debug` step to every job. | `false` | `false` |
| `WorkingDirectory` | `string` | The path to the root of the repo. | `false` | `.` |
295
-
296
-
### Setup and Teardown Scripts
297
-
298
-
The workflow supports automatic execution of setup and teardown scripts for module tests:
299
-
300
-
- Scripts are automatically detected and executed if present
301
-
- If no scripts are found, the workflow continues normally
302
-
303
-
#### Setup - `BeforeAll.ps1`
304
-
305
-
- Place in your test directories (`tests/BeforeAll.ps1`)
306
-
- Runs once before all test matrix jobs to prepare the test environment
307
-
- Deploy test infrastructure, download test data, initialize databases, or configure services
308
-
- Has access to the same environment variables as your tests (secrets, GitHub token, etc.)
309
-
310
-
##### Example - `BeforeAll.ps1`
311
-
312
-
```powershell
313
-
Write-Host "Setting up test environment..."
314
-
# Deploy test infrastructure
315
-
# Download test data
316
-
# Initialize test databases
317
-
Write-Host "Test environment ready!"
318
-
```
319
-
320
-
#### Teardown - `AfterAll.ps1`
321
-
322
-
- Place in your test directories (`tests/AfterAll.ps1`)
323
-
- Runs once after all test matrix jobs complete to clean up the test environment
324
-
- Remove test resources, clean up databases, stop services, or upload artifacts
325
-
- Has access to the same environment variables as your tests
326
-
327
-
##### Example - `AfterAll.ps1`
328
-
329
-
```powershell
330
-
Write-Host "Cleaning up test environment..."
331
-
# Remove test resources
332
-
# Cleanup databases
333
-
# Stop services
334
-
Write-Host "Cleanup completed!"
335
-
```
336
-
337
-
### Secrets
338
-
339
-
The following secrets are used by the workflow. They can be automatically provided (if available) by setting the `secrets: inherit`
340
-
in the workflow file.
341
-
342
-
| Name | Location | Description | Default |
343
-
| ---- | -------- | ----------- | ------- |
344
-
| `APIKEY` | GitHub secrets | The API key for the PowerShell Gallery. | N/A |
345
-
| `TEST_APP_ENT_CLIENT_ID` | GitHub secrets | The client ID of an Enterprise GitHub App for running tests. | N/A |
346
-
| `TEST_APP_ENT_PRIVATE_KEY` | GitHub secrets | The private key of an Enterprise GitHub App for running tests. | N/A |
347
-
| `TEST_APP_ORG_CLIENT_ID` | GitHub secrets | The client ID of an Organization GitHub App for running tests. | N/A |
348
-
| `TEST_APP_ORG_PRIVATE_KEY` | GitHub secrets | The private key of an Organization GitHub App for running tests. | N/A |
349
-
| `TEST_USER_ORG_FG_PAT` | GitHub secrets | The fine-grained personal access token with org access for running tests. | N/A |
350
-
| `TEST_USER_USER_FG_PAT` | GitHub secrets | The fine-grained personal access token with user account access for running tests. | N/A |
351
-
| `TEST_USER_PAT` | GitHub secrets | The classic personal access token for running tests. | N/A |
352
-
353
-
## Permissions
354
-
355
-
If running the action in a restrictive mode, the following permissions need to be granted to the action:
356
-
357
-
```yaml
358
-
permissions:
359
-
contents: write # Create releases
360
-
pull-requests: write # Create comments on the PRs
361
-
statuses: write # Update the status of the PRs from the linter
362
-
```
363
-
364
-
### Publishing to GitHub Pages
365
-
366
-
To publish the documentation to GitHub Pages, the action requires the following permissions:
367
-
368
-
```yaml
369
-
permissions:
370
-
pages: write # Deploy to Pages
371
-
id-token: write # Verify the deployment originates from an appropriate source
372
-
```
373
-
374
-
For more info see [Deploy GitHub Pages site](https://github.com/marketplace/actions/deploy-github-pages-site).
375
-
376
368
## Specifications and practices
377
369
378
-
Process-PSModule follows:
370
+
The process is compatible with:
379
371
380
372
- [Test-Driven Development](https://testdriven.io/test-driven-development/) using [Pester](https://pester.dev) and [PSScriptAnalyzer](https://learn.microsoft.com/en-us/powershell/utility-modules/psscriptanalyzer/overview?view=ps-modules)
0 commit comments