Skip to content

v1.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 17 May 08:53
159c292

🚀 [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.

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.yml to flow Token into GITHUB_TOKEN and into GH_TOKEN/GH_HOST for CLI-driven API calls.
  • Replaced Linux/macOS release metadata curl API calls with a github_api_get helper that prefers gh api and falls back to curl.
  • Updated Windows latest-version resolution headers to conditionally include Authorization only when GITHUB_TOKEN is present.
  • Updated README.md inputs 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.