feat: warn when a newer PiHoleShell release is available - #136
Merged
Merged
Conversation
Adds a best-effort, cached check on module import that compares the installed version against GitHub's latest release and warns if a newer one exists. Designed to never slow down or break Import-Module: - Skipped entirely for a dev/source checkout (version 0.0 or 0.0.0, depending on whether the module or its manifest was imported), so it never fires during this repo's own test suite - Cached for 24 hours so repeat imports don't hit the network or GitHub's rate limit - Opt-out via $env:PIHOLESHELL_SKIP_UPDATE_CHECK for automation - GitHub's "latest release" endpoint already excludes the dev-latest prerelease build, so that's never mistaken for a real update - Any failure (network, parsing) is swallowed silently Co-Authored-By: Claude Sonnet 5 <[email protected]>
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.
Summary
GET /repos/mikemadeja/PiHoleShell/releases/latest) and prints a warning if a newer one existsImport-Module:.psm1(as every test in this repo's suite does) gets PowerShell's auto-assigned version0.0, and importing via the manifest gets the0.0.0placeholder that's only replaced at publish time; both are explicitly treated as "not a real install" and skipped, so this never fires during CI/local test runs$env:PIHOLESHELL_SKIP_UPDATE_CHECKfor automation that wants no network calls at alldev-latestbuild published on every push todevelopis never mistaken for a real updateTest plan
0.0and0.0.0) skip the check, opt-out env var skips the check, warns and caches on a real newer version, no warning when already current/newer, cache reuse within the interval, re-check after cache expiry, never throws on API failureImport-Module .\PiHoleShell.psm1and via a bare.psm1) produces zero warnings and zero network calls🤖 Generated with Claude Code