Skip to content

Commit 2cfb179

Browse files
committed
Change read urp value from branch name
1 parent c4a9be2 commit 2cfb179

File tree

1 file changed

+13
-6
lines changed

1 file changed

+13
-6
lines changed

.github/workflows/upgrade-unity.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,23 @@ jobs:
4444
steps:
4545
- name: Log input parameter
4646
run: |
47+
BRANCH_NAME=${GITHUB_REF#refs/heads/}
48+
49+
echo "Branch: $BRANCH_NAME"
4750
echo "Unity version: $UNITY_VERSION"
4851
echo "Create tags: $CREATE_TAGS"
49-
echo "URP branch: $URP_BRANCH"
5052
echo "Only create tags: $TAGS_ONLY"
5153
echo "Merge master into branch: $MERGE_MASTER"
5254
echo "Custom cli arguments: $CUSTOM_PARAMETERS"
55+
if [[ "$BRANCH_NAME" == *"urp"* ]]
56+
then
57+
echo "urp: true"
58+
else
59+
echo "urp: false"
60+
fi
5361
env:
5462
UNITY_VERSION: ${{ inputs.unityVersion }}
5563
CREATE_TAGS: ${{ inputs.createTags }}
56-
URP_BRANCH: ${{ inputs.urp }}
5764
TAGS_ONLY: ${{ inputs.tagsOnly }}
5865
MERGE_MASTER: ${{ inputs.mergeMaster }}
5966
CUSTOM_PARAMETERS: ${{ inputs.customParameters }}
@@ -107,15 +114,15 @@ jobs:
107114
- name: Set upgrade name
108115
id: upgrade_name
109116
run: |
110-
if [[ "$URP_BRANCH" == "true" ]]
117+
BRANCH_NAME=${GITHUB_REF#refs/heads/}
118+
if [[ "$BRANCH_NAME" == *"urp"* ]]
111119
then
112120
echo "NAME=$UNITY_VERSION-urp" >> $GITHUB_OUTPUT
113121
else
114122
echo "NAME=$UNITY_VERSION" >> $GITHUB_OUTPUT
115123
fi
116124
env:
117125
UNITY_VERSION: ${{ inputs.unityVersion }}
118-
URP_BRANCH: ${{ inputs.urp }}
119126

120127
- name: Log variables
121128
run: |
@@ -166,8 +173,9 @@ jobs:
166173
run: |
167174
# Extract the first four characters of UNITY_VERSION
168175
UNITY_YEAR=${UNITY_VERSION:0:4}
176+
BRANCH_NAME=${GITHUB_REF#refs/heads/}
169177
170-
if [[ "$URP_BRANCH" == "true" ]]
178+
if [[ "$BRANCH_NAME" == *"urp"* ]]
171179
then
172180
if [[ "$UNITY_YEAR" < "2023" ]]
173181
then
@@ -193,5 +201,4 @@ jobs:
193201
git push origin -f --tags
194202
env:
195203
UNITY_VERSION: ${{ inputs.unityVersion }}
196-
URP_BRANCH: ${{ inputs.urp }}
197204

0 commit comments

Comments
 (0)