Skip to content

Commit 985f7da

Browse files
Refactor Action-Test workflow: update job name formatting for clarity; improve input description consistency in action.yml
1 parent a5f6597 commit 985f7da

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

.github/workflows/Action-Test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
os: [ubuntu-latest, windows-latest, macOS-latest]
2525
version: ['', null, 'latest', '7.4.7', '7.5.0'] # '' → should resolve to latest
2626
runs-on: ${{ matrix.os }}
27-
name: ${{ matrix.os }} - ${{ matrix.version == '' && 'latest' || matrix.version }}
27+
name: '${{ matrix.os }} - [${{ matrix.version }}]'
2828
steps:
2929
# 1. Checkout the repo so the local action is available
3030
- name: Checkout repo

action.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: Install PowerShell
22
description: >
3-
Install a specific version —or the latest stable version— of PowerShell Core
3+
Install a specific version —or the latest stable version— of PowerShell Core
44
on any GitHub runner (Linux, macOS, Windows).
55
Skips the install if the requested version is already present.
66
author: PSModule
@@ -15,7 +15,7 @@ inputs:
1515
Use `latest`, `null`, leave it **empty**, or omit the input entirely
1616
to grab the newest stable release automatically.
1717
required: false
18-
default: '' # Empty string → newest release
18+
default: ''
1919

2020
runs:
2121
using: composite
@@ -29,9 +29,8 @@ runs:
2929
set -e
3030
3131
# Resolve empty / 'null' / 'latest' to a concrete version number
32-
if [[ -z "$REQUESTED_VERSION" || \
33-
"${REQUESTED_VERSION,,}" == "latest" || \
34-
"${REQUESTED_VERSION,,}" == "null" ]]; then
32+
lower_req="$(printf '%s' "$REQUESTED_VERSION" | tr '[:upper:]' '[:lower:]')"
33+
if [[ -z "$REQUESTED_VERSION" || "$lower_req" == "latest" || "$lower_req" == "null" ]]; then
3534
REQUESTED_VERSION=$(
3635
curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest \
3736
| grep -oP '"tag_name":\s*"\K([^"]+)' | sed 's/^v//'
@@ -83,9 +82,8 @@ runs:
8382
set -e
8483
8584
# Resolve empty / 'null' / 'latest' to a concrete version number
86-
if [[ -z "$REQUESTED_VERSION" || \
87-
"${REQUESTED_VERSION,,}" == "latest" || \
88-
"${REQUESTED_VERSION,,}" == "null" ]]; then
85+
lower_req="$(printf '%s' "$REQUESTED_VERSION" | tr '[:upper:]' '[:lower:]')"
86+
if [[ -z "$REQUESTED_VERSION" || "$lower_req" == "latest" || "$lower_req" == "null" ]]; then
8987
REQUESTED_VERSION=$(
9088
curl -s https://api.github.com/repos/PowerShell/PowerShell/releases/latest \
9189
| grep -oP '"tag_name":\s*"\K([^"]+)' | sed 's/^v//'

0 commit comments

Comments
 (0)