Skip to content

Conversation

@MariusStorhaug
Copy link
Member

@MariusStorhaug MariusStorhaug commented Apr 20, 2025

Description

This pull request introduces the Install-PowerShell GitHub Action, simplifying installation of specific versions of PowerShell on GitHub runners.

Features:

  • Cross‑platform installer – Runs on all GitHub‑hosted runners (Ubuntu, macOS, Windows). Detects the OS at runtime and executes the appropriate installation routine.
  • Version selector – Installs either a specific PowerShell Core version (e.g. 7.4.1) or the latest stable release when Version: latest is supplied (default).
  • Smart skip logic – Checks the currently installed PowerShell version and skips installation when the requested version is already present, saving time and CI minutes.
  • Native package managers first
    • Linux (Debian/Ubuntu): Uses APT, falling back to direct .deb download if the exact version isn’t in the repo.
    • macOS: Prefers Homebrew Cask; falls back to the official .pkg installer (ARM64/x64 aware).
    • Windows: Downloads the official MSI and installs silently with msiexec.

Metadata Updates:

  • Action Metadata Update: Updated action.yml to reflect the new functionality, including a description, branding changes, and streamlined inputs. Removed unnecessary inputs like Debug and Verbose. action.yml

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

… remove unused scripts and test placeholders.
@MariusStorhaug MariusStorhaug self-assigned this Apr 20, 2025
Copilot AI review requested due to automatic review settings April 20, 2025 16:31
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request introduces the Install-PowerShell action with support for installing PowerShell on Windows, Ubuntu, and macOS, and updates the test workflow to run on multiple operating systems with specified versions.

  • Renames and describes the action to clearly indicate its purpose.
  • Replaces the placeholder test file and updates the composite action steps across different operating systems.
  • Adds a matrix strategy in the workflow to test multiple OS and PowerShell versions.

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
tests/README.md Removed the placeholder file for tests
action.yml Updated action metadata and composite run steps across platforms
.github/workflows/Action-Test.yml Updated test workflow with a matrix strategy for OS/version testing
Files not reviewed (1)
  • scripts/main.ps1: Language not supported
Comments suppressed due to low confidence (1)

action.yml:21

  • The input key is defined as 'Version' in the inputs block but is referenced as 'inputs.version'; ensure consistent casing to avoid potential issues.
$version = '${{ inputs.version }}'

…t detailed component-wise comparison for accurate version checks on Linux and macOS.
…rsions into System.Version objects for accurate comparison and improve error handling during version checks.
… specified version input for accurate installation.
…werShell installation for improved accuracy and error handling
…reamline current version retrieval, and add error handling for download and installation processes.
…improve version comparison logic, and handle multiple package naming formats for downloads.
…nctions, streamline version retrieval, and enhance error handling for installation processes.
…amline version detection, and enhance logging for installation processes across Linux, macOS, and Windows.
…source input, and streamline environment variable setup for PowerShell installation.
…up and directly set environment variables for each OS-specific installation step.
…ion with standard echo statements for improved clarity and consistency across Linux, macOS, and Windows installation steps.
… handling, and improve detected version display for Windows installation.
…ve error handling, and streamline uninstallation process for existing PowerShell installations.
…r Debian/Ubuntu, enhance error handling, and streamline PowerShell installation process.
…ownload .deb from GitHub if exact version not found, and improve error handling for macOS installation via Homebrew.
…e-Host statements for improved consistency across installation steps.
…sting, streamline installation logic, and enhance version detection for PowerShell installations.
…r Linux, macOS, and Windows; enhance handling of empty and 'null' inputs for requested version.
…l' and 'latest'; improve version verification logic for better clarity and error handling.
…; improve input description consistency in action.yml
…st stable release version; enhance command for better reliability and clarity.
… for empty, 'null', and 'latest' inputs; enhance readability of the code.
…ardize version resolution logic across platforms.
…; streamline version resolution logic and add validation for requested version.
…ested version for better visibility during installation.
…ly resolve to latest if explicitly set; improve error messaging for empty version input.
…r 'latest'; add validation for empty version input and enhance error messaging.
…S; improve error handling and fallback logic for Homebrew installation.
…ency; ensure proper formatting in action.yml.
…y on errors for improved reliability in version resolution.
…on headers for improved security and reliability in version resolution.
…le for improved security in Windows installation step.
…les for enhanced security and update API call with authentication headers for improved reliability in version resolution.
@MariusStorhaug MariusStorhaug merged commit 09d87d3 into main Apr 21, 2025
21 checks passed
@MariusStorhaug MariusStorhaug deleted the v1 branch April 21, 2025 11:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants