Skip to content

Commit ea28584

Browse files
authored
fix: output version from pm-detect (#189)
* fix(pm-detect): output version from pm-detect * chore(pm-detect): include version output in outputs
1 parent ecf7b1b commit ea28584

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

package-manager-detect/action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ outputs:
99
name:
1010
description: "The name of the package manager (e.g. npm, pnpm, yarn)"
1111
value: ${{ steps.detect-package-manager.outputs.name }}
12+
version:
13+
description: "The version of the package manager (e.g. 10.1.0, 10.1.1)"
14+
value: ${{ steps.detect-package-manager.outputs.version }}
1215
lockFilePath:
1316
description: "The path to the lock file (e.g. package-lock.json, pnpm-lock.yaml, yarn.lock)"
1417
value: ${{ steps.detect-package-manager.outputs.lock-file-path }}
@@ -54,6 +57,7 @@ runs:
5457
5558
# Parse the JSON and extract individual values
5659
NAME=$(echo "$PM_OUTPUT" | jq -r '.name')
60+
VERSION=$(echo "$PM_OUTPUT" | jq -r '.version')
5761
LOCK_FILE_PATH=$(echo "$PM_OUTPUT" | jq -r '.lockFilePath')
5862
AGENT=$(echo "$PM_OUTPUT" | jq -r '.agent')
5963
INSTALL_CMD=$(echo "$PM_OUTPUT" | jq -r '.install')
@@ -68,6 +72,7 @@ runs:
6872
6973
# Set outputs
7074
echo "name=$NAME" >> $GITHUB_OUTPUT
75+
echo "version=$VERSION" >> $GITHUB_OUTPUT
7176
echo "lock-file-path=$LOCK_FILE_PATH" >> $GITHUB_OUTPUT
7277
echo "agent=$AGENT" >> $GITHUB_OUTPUT
7378
echo "install-cmd=$INSTALL_CMD" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)