Added get-product-name action.
This commit is contained in:
25
unity-get-product-name/action.yaml
Normal file
25
unity-get-product-name/action.yaml
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user