fix: Skip PSScriptAnalyzer install on cache hit#12
Conversation
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, which can trigger a NullReferenceException in PSScriptAnalyzer. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughAdds Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
Updates the CI lint workflow to avoid reinstalling PSScriptAnalyzer when it’s already restored from the GitHub Actions cache, preventing install/load conflicts during lint runs.
Changes:
- Adds a step
idto the PowerShell modules cache step. - Gates the
Install PSScriptAnalyzerstep to only run on cache misses.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
Install-Moduleeven when PSScriptAnalyzer was already restored from cacheInstall-Module -Forceto conflict with the already-loaded cached module, which can trigger aNullReferenceExceptionin PSScriptAnalyzeridto the cache step and anifcondition on the install step so it only runs on cache missworkflow_dispatchtrigger to allow manual CI runsTest Plan
Install-Modulestep is skippedworkflow_dispatchtrigger allows manual CI runs from the Actions tab🤖 Generated with Claude Code