From 498792cc12a75d181b805f76248642998df0776e Mon Sep 17 00:00:00 2001 From: Scion Date: Sat, 28 Jun 2025 22:05:01 -0700 Subject: [PATCH] Added get-product-name action. --- unity-get-product-name/action.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 unity-get-product-name/action.yaml diff --git a/unity-get-product-name/action.yaml b/unity-get-product-name/action.yaml new file mode 100644 index 0000000..504e321 --- /dev/null +++ b/unity-get-product-name/action.yaml @@ -0,0 +1,25 @@ +name: unity-get-product-name +description: "Get the correct Unity product name from a provided project." +inputs: + projectPath: + description: "Path to the Unity project." + required: true + default: "." +outputs: + productName: + description: "Unity product name." + value: ${{ steps.getProductName.outputs.productName }} +runs: + using: "composite" + steps: + - name: "Get Unity project name." + id: getProductName + run: | + PRODUCT_KEY="productName" + PRODUCT_FILE="ProjectSettings/ProjectSettings.asset" + PRODUCT_FILE_PATH="${{ inputs.projectPath }}/$PRODUCT_FILE" + + PRODUCT=$(grep -w $PRODUCT_KEY $PRODUCT_FILE_PATH | cut -d ':' -f2 | xargs) + + echo "productName=$PRODUCT" >> "$GITHUB_OUTPUT" + shell: bash