Skip to content

Commit 1cfb5cb

Browse files
tablackburnclaude
andauthored
fix: Skip PSScriptAnalyzer install on cache hit (#35)
The lint job was unconditionally running Install-Module even when the module was already restored from cache. This caused Install-Module -Force to conflict with the already-loaded cached module, triggering a NullReferenceException in PSScriptAnalyzer. Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 6c34dbb commit 1cfb5cb

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

.github/workflows/CI.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
- uses: actions/checkout@v6
1919

2020
- name: Cache PowerShell modules
21+
id: cache-lint-modules
2122
uses: actions/cache@v5
2223
with:
2324
path: ~/.local/share/powershell/Modules
@@ -26,6 +27,7 @@ jobs:
2627
${{ runner.os }}-psmodules-lint-
2728
2829
- name: Install PSScriptAnalyzer
30+
if: steps.cache-lint-modules.outputs.cache-hit != 'true'
2931
shell: pwsh
3032
run: |
3133
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

0 commit comments

Comments
 (0)