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