🚀 [Feature]: Token-controlled GitHub release lookup now supports authenticated or anonymous mode (#26)
Install-PowerShell now lets workflows control how release metadata is fetched from GitHub, including default GitHub token usage, custom token usage, and fully anonymous lookup when no token is provided. This keeps existing workflows working while making rate-limit and restricted-permission scenarios easier to handle.
- Fixes #23
New: Configurable authentication for release metadata lookup
The action now supports a Token input that controls authentication for GitHub API requests used during version resolution. By default, it behaves exactly as before by using ${{ github.token }}, and workflows can now explicitly provide a custom token or set Token: '' for anonymous API calls.
- uses: PSModule/install-powershell@v1
with:
Version: latest
Token: ''An optional Host input is also available for environments that need a non-default GitHub host.
Changed: Linux and macOS API queries now use GitHub CLI API path when available
GitHub API calls that resolve release information on Linux and macOS now use the GitHub CLI API path, with a compatible REST fallback when the CLI is not available. Package download behavior remains unchanged.
Fixed: Empty token no longer sends an Authorization header
When token input is empty, all platform-specific API calls now omit the Authorization header so anonymous release lookups work as expected.
Technical Details
- Updated action inputs and platform env wiring in
action.ymlto flowTokenintoGITHUB_TOKENand intoGH_TOKEN/GH_HOSTfor CLI-driven API calls. - Replaced Linux/macOS release metadata curl API calls with a
github_api_gethelper that prefersgh apiand falls back tocurl. - Updated Windows latest-version resolution headers to conditionally include
Authorizationonly whenGITHUB_TOKENis present. - Updated
README.mdinputs and secrets documentation for token/host behavior. - Implementation plan progress: all core change tasks completed; documentation task for adding explicit usage examples remains open and can be added in a follow-up update.