fix(ci): register PSGallery before trusting it - #13
Merged
Conversation
The hosted runner image no longer ships with PSGallery pre-registered, so 'Set-PSRepository PSGallery -InstallationPolicy Trusted' now fails hard: Set-PSRepository: No repository with the name 'PSGallery' was found. This broke the PowerShell Analysis job (and would break both Pester jobs on their next run) in ci.yml - a workflow untouched by the trivy permissions fix merged in #12. Last green ci.yml run was 2026-08-04; the image changed since. Register-PSRepository -Default when PSGallery is absent, then trust it as before. Applied to all three call sites (PSScriptAnalyzer install, Windows Pester install, Linux Pester install) so the next scheduled run does not rediscover it. private-toolkit is unaffected because it calls Install-Module directly without touching the repository registration.
Windows Test Results609 tests 609 ✅ 36s ⏱️ Results for commit c6f9fde. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Post-merge
mainsurfaced an unrelated failure inci.yml— a workflow #12 never touched.The hosted runner image no longer ships PSGallery pre-registered, so
Set-PSRepositoryfails outright. Last greenci.ymlrun was 2026-08-04, so this is a runner-image regression that surfaced on the first push since.Fix registers the default repositories when PSGallery is missing, then trusts it exactly as before. Applied to all three call sites — PSScriptAnalyzer install, Windows Pester install, Linux Pester install — so the next scheduled run doesn't rediscover it in the other two.
private-toolkitis unaffected: it callsInstall-Moduledirectly and never touches repository registration.