Skip to content

Commit 91b2259

Browse files
🩹 [Patch]: Update GitHub Actions workflow permissions and add documentation linting step; enhance module test function with control notes
1 parent e9f43e3 commit 91b2259

File tree

3 files changed

+36
-1
lines changed

3 files changed

+36
-1
lines changed

‎.github/workflows/Action-Test.yml‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.ref }}
1616
cancel-in-progress: true
1717

18-
permissions: {}
18+
permissions:
19+
contents: read # to checkout the repo
20+
statuses: write # to create commit status
1921

2022
jobs:
2123
ActionTestDefault:
@@ -24,6 +26,9 @@ jobs:
2426
steps:
2527
- name: Checkout repo
2628
uses: actions/checkout@v5
29+
with:
30+
persist-credentials: false
31+
fetch-depth: 0
2732

2833
- name: Upload module artifact
2934
uses: actions/upload-artifact@v4
@@ -38,3 +43,21 @@ jobs:
3843
with:
3944
Name: PSModuleTest
4045
WorkingDirectory: tests/srcTestRepo
46+
47+
- name: Get changes
48+
uses: PSModule/GitHub-Script@v1
49+
with:
50+
Script: |
51+
LogGroup "List files" {
52+
Get-ChildItem -Recurse -File | Select-Object -ExpandProperty FullName | Sort-Object
53+
}
54+
LogGroup "Commit changes" {
55+
git add tests/srcTestRepo/outputs/docs/
56+
git commit -m "Update documentation"
57+
}
58+
59+
- name: Lint documentation
60+
uses: super-linter/super-linter/slim@7bba2eeb89d01dc9bfd93c497477a57e72c83240 # v8.2.0
61+
env:
62+
GITHUB_TOKEN: ${{ github.token }}
63+
VALIDATE_MARKDOWN: true

‎tests/srcTestRepo/outputs/module/PSModuleTest/PSModuleTest.psm1‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,12 @@ function Set-PSModuleTest {
314314
Test-PSModule -Name 'World'
315315
316316
"Hello, World!"
317+
318+
.NOTES
319+
Controls:
320+
- :q : Quit
321+
- :q! : Quit without saving
322+
- :wq : Save and quit
317323
#>
318324
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
319325
'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function',

‎tests/srcTestRepo/src/functions/public/SomethingElse/Set-PSModuleTest.ps1‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
Test-PSModule -Name 'World'
88
99
"Hello, World!"
10+
11+
.NOTES
12+
Controls:
13+
- :q : Quit
14+
- :q! : Quit without saving
15+
- :wq : Save and quit
1016
#>
1117
[Diagnostics.CodeAnalysis.SuppressMessageAttribute(
1218
'PSUseShouldProcessForStateChangingFunctions', '', Scope = 'Function',

0 commit comments

Comments
 (0)