Skip to content

Commit 5dd0c7e

Browse files
Refactor permissions formatting in workflow files for consistency
1 parent 7d80faa commit 5dd0c7e

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

.github/workflows/Plan.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ on:
7070
value: ${{ jobs.Plan.outputs.CreateRelease }}
7171

7272
permissions:
73-
contents: read # to checkout the repo
74-
pull-requests: write # to add labels / comments to PRs
73+
contents: read # to checkout the repo
74+
pull-requests: write # to add labels / comments to PRs
7575

7676
jobs:
7777
Plan:

.github/workflows/workflow.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ on:
7070
^README\.md$
7171
7272
permissions:
73-
contents: write # to checkout the repo and create releases on the repo
73+
contents: write # to checkout the repo and create releases on the repo
7474
pull-requests: write # to write comments to PRs
75-
statuses: write # to update the status of the workflow from linter
76-
pages: write # to deploy to Pages
77-
id-token: write # to verify the deployment originates from an appropriate source
75+
statuses: write # to update the status of the workflow from linter
76+
pages: write # to deploy to Pages
77+
id-token: write # to verify the deployment originates from an appropriate source
7878

7979
jobs:
8080
# Runs on:

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ When `ReleaseType` is `None`, when an `IgnoreLabels` label is present, or when n
161161
### Plan job
162162

163163
[workflow](#plan)
164+
164165
- Reads the settings file `.github/PSModule.yml` in the module repository to configure the workflow.
165166
- Gathers context for the process from GitHub and the repo files, configuring what tests to run, if and what kind of release to create, and whether
166167
to setup testing infrastructure and what operating systems to run the tests on.
@@ -169,11 +170,13 @@ When `ReleaseType` is `None`, when an `IgnoreLabels` label is present, or when n
169170
### Build module
170171

171172
[workflow](./.github/workflows/Build-Module.yml)
173+
172174
- Compiles the module source code into a PowerShell module.
173175

174176
### Test source code
175177

176178
[workflow](./.github/workflows/Test-SourceCode.yml)
179+
177180
- Tests the source code in parallel (matrix) using:
178181
- [PSModule framework settings for style and standards for source code](https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#sourcecode-tests)
179182
- This produces a JSON-based report that is used by [Get-PesterTestResults](#get-test-results) evaluate the results of the tests.
@@ -193,17 +196,18 @@ The [PSModule - SourceCode tests](./scripts/tests/SourceCode/PSModule/PSModule.T
193196
| ParamBlock | Functions (Generic) | Functions should have a parameter block (`param()`). |
194197
| FunctionTest | Functions (Public) | All public functions/filters should have corresponding tests. |
195198

196-
197199
### Lint source code
198200

199201
[workflow](./.github/workflows/Lint-SourceCode.yml)
202+
200203
- Lints the source code in parallel (matrix) using:
201204
- [PSScriptAnalyzer rules](https://github.com/PSModule/Invoke-ScriptAnalyzer)
202205
- This produces a JSON-based report that is used by [Get-PesterTestResults](#get-test-results) evaluate the results of the linter.
203206

204207
### Framework test
205208

206209
[workflow](./.github/workflows/Test-Module.yml)
210+
207211
- Tests and lints the module in parallel (matrix) using:
208212
- [PSModule framework settings for style and standards for modules](https://github.com/PSModule/Test-PSModule?tab=readme-ov-file#module-tests)
209213
- [PSScriptAnalyzer rules](https://github.com/PSModule/Invoke-ScriptAnalyzer)
@@ -220,6 +224,7 @@ The [PSModule - SourceCode tests](./scripts/tests/SourceCode/PSModule/PSModule.T
220224
### Test module
221225

222226
[workflow](./.github/workflows/Test-ModuleLocal.yml)
227+
223228
- Imports and tests the module in parallel (matrix) using Pester tests from the module repository.
224229
- Supports setup and teardown scripts executed via separate dedicated jobs:
225230
- `BeforeAll`: Runs once before all test matrix jobs to set up the test environment (e.g., deploy infrastructure, download test data).
@@ -332,7 +337,6 @@ Use a consistent naming scheme so that resources are easy to identify and clean
332337
When tests use multiple authentication contexts that share the same runner, include a token or context identifier in
333338
the name to avoid collisions (for example, `Test-{OS}-{ContextID}-{RunID}`).
334339

335-
336340
#### Module tests
337341

338342
The [PSModule - Module tests](./scripts/tests/Module/PSModule/PSModule.Tests.ps1) verifies the following coding practices that the framework enforces:
@@ -345,12 +349,14 @@ The [PSModule - Module tests](./scripts/tests/Module/PSModule/PSModule.Tests.ps1
345349
### Get test results
346350

347351
[workflow](./.github/workflows/Get-TestResults.yml)
352+
348353
- Gathers the test results from the previous steps and creates a summary of the results.
349354
- If any tests have failed, the workflow will fail here.
350355

351356
### Get code coverage
352357

353358
[workflow](./.github/workflows/Get-CodeCoverage.yml)
359+
354360
- Gathers the code coverage from the previous steps and creates a summary of the results.
355361
- Aggregates coverage from the [Framework test](#framework-test) step (framework-generated boilerplate) and the
356362
[Test module](#test-module) step (module author code). A command executed in either step counts as covered, so
@@ -360,6 +366,7 @@ The [PSModule - Module tests](./scripts/tests/Module/PSModule/PSModule.Tests.ps1
360366
### Publish module
361367

362368
[workflow](./.github/workflows/Publish-Module.yml)
369+
363370
- Publishes the module to the PowerShell Gallery.
364371
- Creates a release on the GitHub repository.
365372
- Attaches the built module as a `.zip` asset on the GitHub Release so consumers can download the exact bytes that were tested and pushed to the PowerShell Gallery.
@@ -371,12 +378,14 @@ The [PSModule - Module tests](./scripts/tests/Module/PSModule/PSModule.Tests.ps1
371378
### Build docs
372379

373380
[workflow](./.github/workflows/Build-Docs.yml)
381+
374382
- Generates documentation and lints the documentation using:
375383
- [super-linter](https://github.com/super-linter/super-linter).
376384

377385
### Build site
378386

379387
[workflow](./.github/workflows/Build-Site.yml)
388+
380389
- Generates a static site using:
381390
- [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/).
382391

0 commit comments

Comments
 (0)