File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -99,14 +99,16 @@ jobs:
9999 id : pkg_name
100100 shell : bash
101101 run : |
102- # Find the first tar.gz or zip file and extract basename without extension
103- PKG_FILE=$(ls pkg/ *.tar.gz pkg/ *.zip 2>/dev/null | head -1)
102+ # Find tar.gz or zip file (using find to avoid glob expansion issues)
103+ PKG_FILE=$(find pkg -maxdepth 1 -type f \( -name " *.tar.gz" -o -name " *.zip" \) | head -1)
104104 if [ -z "$PKG_FILE" ]; then
105105 echo "ERROR: No package file found"
106106 exit 1
107107 fi
108- # Remove directory and extension(s) to get package name
109- PKG_NAME=$(basename "$PKG_FILE" | sed -E 's/\.(tar\.gz|zip)$//')
108+ # Get basename and remove extensions using parameter expansion (portable)
109+ PKG_BASE=$(basename "$PKG_FILE")
110+ PKG_NAME="${PKG_BASE%.tar.gz}"
111+ PKG_NAME="${PKG_NAME%.zip}"
110112 echo "PACKAGE_NAME=$PKG_NAME" >> $GITHUB_OUTPUT
111113 echo "Package name: $PKG_NAME"
112114
You can’t perform that action at this time.
0 commit comments