Skip to content

Action-Test - [🌟 [Major]: Introducing Install-PowerShell action #1] by @MariusStorhaug #39

Action-Test - [🌟 [Major]: Introducing Install-PowerShell action #1] by @MariusStorhaug

Action-Test - [🌟 [Major]: Introducing Install-PowerShell action #1] by @MariusStorhaug #39

Workflow file for this run

name: Action-Test
run-name: "Action-Test - [${{ github.event.pull_request.title }} #${{ github.event.pull_request.number }}] by @${{ github.actor }}"
on:
workflow_dispatch:
pull_request:
schedule:
- cron: '0 0 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
pull-requests: read
jobs:
ActionTestBasic:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
version: ['', null, 'latest', '7.4.7', '7.5.0'] # '' → should resolve to latest
runs-on: ${{ matrix.os }}
name: '${{ matrix.os }} - [${{ matrix.version }}]'
steps:
# 1. Checkout the repo so the local action is available
- name: Checkout repo
uses: actions/checkout@v4
# 2. Run the action under test
- name: Action-Test
uses: ./
with:
Version: ${{ matrix.version }}
# 3. Verify the installed PowerShell version
- name: Verify installed version
shell: pwsh
run: |
# Requested version that came from the matrix
$requested = '${{ matrix.version }}'
# When empty / 'null' / 'latest' → resolve to latest stable release
if ([string]::IsNullOrWhiteSpace($requested) -or
$requested.Trim().ToLower() -in @('latest','null')) {
$requested = (Invoke-RestMethod `
-Uri 'https://api.github.com/repos/PowerShell/PowerShell/releases/latest'
).tag_name.TrimStart('v')
Write-Host "Resolved 'latest' → $requested"
}
# Actual version installed by the action
$installed = ($PSVersionTable.PSVersion).ToString()
Write-Host "Installed PowerShell version: $installed"
Write-Host "Expected PowerShell version: $requested"
if ($installed -ne $requested) {
throw "Failed: expected $requested but got $installed"
}