Skip to content

Commit 8671d8b

Browse files
🌟 [Major]: Introducing the Invoke-ScriptAnalyzer GitHub Action (#1)
## Description This pull request introduces the `Invoke-ScriptAnalyzer` GitHub Action. ### Workflow Updates: * **New Workflows Added:** - [`.github/workflows/Action-Test-Src-Default.yml`](diffhunk://#diff-8ecb4765631346daa3fc827a56e509b7e8c1db0fc5ce7e3736bfea19531c0779R1-R23): A workflow for testing source code without a manifest. - [`.github/workflows/Action-Test-Src-WithManifest.yml`](diffhunk://#diff-6b415bfca4385019a4a012a0677a3f583897f8c0ed23335673a87fc7962f0aecR1-R23): A workflow for testing source code with a manifest. - [`.github/workflows/Action-Test-outputs.yml`](diffhunk://#diff-0d613011b57a43efc563d0da352dd07193e4d4c51d18b3960d164386b56500c9R1-R24): A workflow for testing output modules. * **Workflow Call Configuration:** - [`.github/workflows/ActionTestWorkflow.yml`](diffhunk://#diff-233e0a5ba9262bb06e98baed63e42420170aeb6a8118339a661edb824bdac3fcR1-R50): Added a reusable workflow configuration for action tests, supporting multiple operating systems and dynamic inputs. ### Action Configuration: * **Action Metadata:** - [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6L1-R49): Updated the action metadata to reflect the new name and description, and revised the inputs and outputs for better clarity and functionality. * **Main Script Update:** - [`scripts/main.ps1`](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011L1-R27): Refactored the main script to handle different test types and resolve paths dynamically. ### Documentation Enhancements: * **README.md:** - [`README.md`](diffhunk://#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5L1-R103): Updated the README to provide detailed information about the action, its inputs, outputs, and usage examples. * **Settings File Documentation:** - [`SettingsFileDocumentation.md`](diffhunk://#diff-ec332c2287ceca47b490fb59ae3fb116c6bf2593930ebb03420be5212df9a29bR1-R116): Added comprehensive documentation for the PSScriptAnalyzer settings file format and usage. ### Additional Changes: * **Test Configuration Files:** - [`scripts/tests/PSScriptAnalyzer/Module.Settings.psd1`](diffhunk://#diff-5324d852ef540e7cce761446eea1c13584a8f905c6b16b6fde8b550b84548b16R1-R53): Added a new settings file for module tests. - [`scripts/tests/PSScriptAnalyzer/PSScriptAnalyzer.Configuration.ps1`](diffhunk://#diff-4b77957e9165d3d4f445b09630bfb69dfbc7ab0b67e5ce081484d057514c700fR1-R5): Added a configuration file for PSScriptAnalyzer. - [`scripts/tests/PSScriptAnalyzer/PSScriptAnalyzer.Container.ps1`](diffhunk://#diff-08e46f8aae6cf9cb8333b6eee2fb1cc2d0bbabf38b7019b4671c2570c579467aR1-R9): Added a container configuration script for running tests. ## Type of change <!-- Use the check-boxes [x] on the options that are relevant. --> - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [x] 🌟 [Breaking change] ## Checklist <!-- Use the check-boxes [x] on the options that are relevant. --> - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas
1 parent 56ac181 commit 8671d8b

File tree

101 files changed

+2993
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

101 files changed

+2993
-202
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Action-Test [Src-Default]
2+
3+
run-name: "Action-Test [Src-Default] - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions: {}
16+
17+
jobs:
18+
ActionTest:
19+
uses: ./.github/workflows/ActionTestWorkflow.yml
20+
with:
21+
TestType: Src-Default
22+
Path: tests/srcTestRepo/src
23+
Settings: SourceCode
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Action-Test [Src-WithManifest]
2+
3+
run-name: "Action-Test [Src-WithManifest] - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions: {}
16+
17+
jobs:
18+
ActionTest:
19+
uses: ./.github/workflows/ActionTestWorkflow.yml
20+
with:
21+
TestType: Src-WithManifest
22+
Path: tests/srcWithManifestTestRepo/src
23+
Settings: SourceCode
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Action-Test [outputs]
2+
3+
run-name: "Action-Test [outputs] - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
workflow_dispatch:
7+
pull_request:
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
permissions: {}
16+
17+
jobs:
18+
ActionTest:
19+
uses: ./.github/workflows/ActionTestWorkflow.yml
20+
with:
21+
TestType: outputs
22+
Path: tests/outputTestRepo/outputs/modules/PSModuleTest
23+
Settings: Module
24+
SettingsFilePath:

.github/workflows/Action-Test.yml

Lines changed: 0 additions & 32 deletions
This file was deleted.
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
TestType:
5+
type: string
6+
required: true
7+
Path:
8+
type: string
9+
required: true
10+
Settings:
11+
type: string
12+
required: false
13+
SettingsFilePath:
14+
type: string
15+
required: false
16+
17+
permissions: {}
18+
19+
jobs:
20+
ActionTest:
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
os: [ubuntu-latest, macos-latest, windows-latest]
25+
name: Action-Test [outputs] - [${{ matrix.os }}]
26+
runs-on: ${{ matrix.os }}
27+
steps:
28+
- name: Checkout repo
29+
uses: actions/checkout@v4
30+
31+
- name: Initialize environment
32+
uses: PSModule/Initialize-PSModule@main
33+
34+
- name: Action-Test
35+
uses: ./
36+
id: action-test
37+
with:
38+
Path: ${{ inputs.Path }}
39+
Settings: ${{ inputs.Settings }}
40+
SettingsFilePath: ${{ inputs.SettingsFilePath }}
41+
42+
- name: Status
43+
shell: pwsh
44+
env:
45+
PASSED: ${{ steps.action-test.outputs.passed }}
46+
run: |
47+
Write-Host "Passed: [$env:PASSED]"
48+
if ($env:PASSED -ne 'true') {
49+
exit 1
50+
}

.github/workflows/Auto-Configure.yml

Lines changed: 0 additions & 34 deletions
This file was deleted.

.github/workflows/Auto-Document.yml

Lines changed: 0 additions & 31 deletions
This file was deleted.

.github/workflows/Auto-Release.yml

Lines changed: 36 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,36 @@
1-
name: Auto-Release
2-
3-
run-name: "Auto-Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4-
5-
on:
6-
pull_request_target:
7-
branches:
8-
- main
9-
types:
10-
- closed
11-
- opened
12-
- reopened
13-
- synchronize
14-
- labeled
15-
16-
concurrency:
17-
group: ${{ github.workflow }}-${{ github.ref }}
18-
cancel-in-progress: true
19-
20-
permissions:
21-
contents: write # Required to create releases
22-
pull-requests: write # Required to create comments on the PRs
23-
24-
jobs:
25-
Auto-Release:
26-
runs-on: ubuntu-latest
27-
steps:
28-
- name: Checkout Code
29-
uses: actions/checkout@v4
30-
31-
- name: Auto-Release
32-
uses: PSModule/Auto-Release@v1
33-
env:
34-
GITHUB_TOKEN: ${{ github.token }}
1+
name: Auto-Release
2+
3+
run-name: "Auto-Release - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
4+
5+
on:
6+
pull_request_target:
7+
branches:
8+
- main
9+
types:
10+
- closed
11+
- opened
12+
- reopened
13+
- synchronize
14+
- labeled
15+
16+
concurrency:
17+
group: ${{ github.workflow }}-${{ github.ref }}
18+
cancel-in-progress: true
19+
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
24+
jobs:
25+
Auto-Release:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- name: Checkout Code
29+
uses: actions/checkout@v4
30+
31+
- name: Auto-Release
32+
uses: PSModule/Auto-Release@v1
33+
env:
34+
GITHUB_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication
35+
with:
36+
IncrementalPrerelease: false

LICENSE

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
MIT License
2-
3-
Copyright (c) 2025 PSModule
4-
5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
11-
12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
14-
15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
1+
MIT License
2+
3+
Copyright (c) 2025 PSModule
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

0 commit comments

Comments
 (0)