From 1d72e9a8e22b5ec47f4dffc4afa465d9df5187a4 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Thu, 20 Feb 2025 01:10:25 +0100 Subject: [PATCH 1/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20hashtable?= =?UTF-8?q?=20as=20a=20requirement=20(#30)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This pull request includes a small change to the `scripts/main.ps1` file. The change adds the `Hashtable` module to the `$requiredModules` list. * [`scripts/main.ps1`](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011R15): Added `Hashtable` to the `$requiredModules` list. ## Type of change - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [ ] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas --- scripts/main.ps1 | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 61614a3..86c70e9 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -12,6 +12,7 @@ $requiredModules = @{ PSScriptAnalyzer = @{} PlatyPS = @{} MarkdownPS = @{} + Hashtable = @{} # 'Microsoft.PowerShell.PlatyPS' = @{ # Prerelease = $true # } From 41e8d81931a706b5a67720e5ae4f8897df8bacca Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 28 Feb 2025 21:12:21 +0100 Subject: [PATCH 2/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Add=20WorkingDire?= =?UTF-8?q?ctory=20input=20to=20action=20configuration=20and=20README=20(#?= =?UTF-8?q?31)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This pull request introduces a new input parameter to specify the working directory for the script execution in the PSModule framework. The changes are reflected in the documentation and the action configuration file. ### Documentation Update * `README.md`: * Added a description for the new `WorkingDirectory` parameter, specifying its default value as `${{ github.workspace }}`. ### Action Configuration * `action.yml`: * Introduced the `WorkingDirectory` input parameter with a description, default value, and its inclusion in the `runs` section to pass the value to the script. ## Type of change - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- README.md | 1 + action.yml | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index ec0f2b9..e08a0b0 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,7 @@ The Initialize-PSModule action will prepare the runner for the PSModule framewor | `Verbose` | Enable verbose output. | `false` | `'false'` | | `Version` | Specifies the version of the GitHub module to be installed. The value must be an exact version. | `false` | | | `Prerelease` | Allow prerelease versions if available. | `false` | `'false'` | +| `WorkingDirectory` | The working directory where the script runs. | `false` | `${{ github.workspace }}` | ## Example diff --git a/action.yml b/action.yml index 90d0485..00e19c1 100644 --- a/action.yml +++ b/action.yml @@ -21,6 +21,10 @@ inputs: description: Allow prerelease versions if available. required: false default: 'false' + WorkingDirectory: + description: The working directory where the script will run from. + required: false + default: ${{ github.workspace }} runs: using: composite @@ -32,6 +36,7 @@ runs: Prerelease: ${{ inputs.Prerelease }} Verbose: ${{ inputs.Verbose }} Version: ${{ inputs.Version }} + WorkingDirectory: ${{ inputs.WorkingDirectory }} Script: | # Initialize-PSModule ${{ github.action_path }}\scripts\main.ps1 From 63e79780414e5ff7ff4eb4e1f969c21c553ca078 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sat, 1 Mar 2025 11:12:19 +0100 Subject: [PATCH 3/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Fix=20path=20sepa?= =?UTF-8?q?rator=20in=20action=20script=20execution=20(#32)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This pull request includes a minor change to the `action.yml` file. The change updates the path format for the script execution from backslashes to forward slashes. * [`action.yml`](diffhunk://#diff-1243c5424efaaa19bd8e813c5e6f6da46316e63761421b3e5f5c8ced9a36e6b6L42-R42): Updated the script path from `\scripts\main.ps1` to `/scripts/main.ps1` to use forward slashes. ## Type of change - [ ] 📖 [Docs] - [x] 🪲 [Fix] - [ ] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/action.yml b/action.yml index 00e19c1..aac4d86 100644 --- a/action.yml +++ b/action.yml @@ -39,4 +39,4 @@ runs: WorkingDirectory: ${{ inputs.WorkingDirectory }} Script: | # Initialize-PSModule - ${{ github.action_path }}\scripts\main.ps1 + ${{ github.action_path }}/scripts/main.ps1 From aee74ed37f795a9e5e3f7dd33b382fada653f1e4 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Sun, 2 Mar 2025 10:31:12 +0100 Subject: [PATCH 4/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Refactor=20output?= =?UTF-8?q?=20handling=20in=20main.ps1=20for=20improved=20readability=20(#?= =?UTF-8?q?33)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This pull request includes several changes to the `scripts/main.ps1` file to improve the readability and output formatting of the script. The most important changes include: * Removed unnecessary `Write-Output` calls that wrapped the `Get-PSResource` and `Get-Command` outputs. * Added `Out-String` to the `Format-Table` command to ensure the table output is properly formatted as a string. ## Type of change - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- scripts/main.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index 86c70e9..db83177 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -36,12 +36,12 @@ $requiredModules.GetEnumerator() | Sort-Object | ForEach-Object { } } Write-Output "Installed module: [$name]" - Write-Output (Get-PSResource -Name $name | Select-Object * | Out-String) + Get-PSResource -Name $name | Select-Object * | Out-String Write-Output 'Module commands:' - Write-Output (Get-Command -Module $name | Out-String) + Get-Command -Module $name | Out-String } } $requiredModules.Keys | Get-InstalledPSResource -Verbose:$false | Sort-Object -Property Name | - Format-Table -Property Name, Version, Prerelease, Repository -AutoSize -Wrap + Format-Table -Property Name, Version, Prerelease, Repository -AutoSize | Out-String From 38c1a5b407c376ad033bb8a0e37a2a0945ee80aa Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 7 Mar 2025 22:07:55 +0100 Subject: [PATCH 5/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Show=20all=20inst?= =?UTF-8?q?alled=20modules=20in=20summary=20(#34)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This pull request includes a small change to the `scripts/main.ps1` file. The change simplifies the command by removing the unnecessary enumeration of `$requiredModules.Keys` before calling `Get-InstalledPSResource`. * [`scripts/main.ps1`](diffhunk://#diff-dc2e5a659836b1b73abb03421c567f5018c2755677c4a0aa764cb26117b68011L46-R46): Simplified the command by removing `$requiredModules.Keys` before calling `Get-InstalledPSResource`. ## Type of change - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- scripts/main.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/main.ps1 b/scripts/main.ps1 index db83177..80e7e51 100644 --- a/scripts/main.ps1 +++ b/scripts/main.ps1 @@ -43,5 +43,5 @@ $requiredModules.GetEnumerator() | Sort-Object | ForEach-Object { } } -$requiredModules.Keys | Get-InstalledPSResource -Verbose:$false | Sort-Object -Property Name | +Get-InstalledPSResource -Verbose:$false | Sort-Object -Property Name | Format-Table -Property Name, Version, Prerelease, Repository -AutoSize | Out-String From e171163bf08c81b431834732c85e2364515cb321 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Fri, 7 Mar 2025 22:39:01 +0100 Subject: [PATCH 6/6] =?UTF-8?q?=F0=9F=A9=B9=20[Patch]:=20Remove=20GITHUB?= =?UTF-8?q?=5FTOKEN=20environment=20variable=20from=20Auto-Release=20(#35)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This pull request includes a small change to the `.github/workflows/Auto-Release.yml` file. The change removes the `env` section which contained the `GITHUB_TOKEN` used for GitHub CLI authentication. * [`.github/workflows/Auto-Release.yml`](diffhunk://#diff-d3f6900ee5159d4bc4ba6d893e2dd8443c2691b0490d7351cffbd7a37ed8d95aL33-L34): Removed the `env` section with the `GITHUB_TOKEN` used for GitHub CLI authentication. ## Type of change - [ ] 📖 [Docs] - [ ] 🪲 [Fix] - [x] 🩹 [Patch] - [ ] ⚠️ [Security fix] - [ ] 🚀 [Feature] - [ ] 🌟 [Breaking change] ## Checklist - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas --- .github/workflows/Auto-Release.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/Auto-Release.yml b/.github/workflows/Auto-Release.yml index ec157c9..680da5c 100644 --- a/.github/workflows/Auto-Release.yml +++ b/.github/workflows/Auto-Release.yml @@ -30,7 +30,5 @@ jobs: - name: Auto-Release uses: PSModule/Auto-Release@v1 - env: - GITHUB_TOKEN: ${{ github.token }} # Used for GitHub CLI authentication with: IncrementalPrerelease: false