Skip to content

Commit 9e1834a

Browse files
authored
Added branch name retrieval in Cloud Build trigger
1 parent 2b77f62 commit 9e1834a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

.github/workflows/unity-cloud-check.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,12 @@ jobs:
2323
- name: Trigger Cloud Build
2424
id: trigger
2525
run: |
26+
branch_name="${{ github.head_ref || github.ref_name }}"
27+
2628
build_number=$(curl -s -X POST \
2729
-H "Authorization: Basic ${{ secrets.UNITY_API_KEY }}" \
30+
-H "Content-Type: application/json" \
31+
-d "{\"clean\": true, \"delay\": 0, \"commit\": null, \"headless\": true, \"branch\": \"$branch_name\"}" \
2832
https://build-api.cloud.unity3d.com/api/v1/orgs/6872789246035/projects/5fac262b-e52e-42f7-a9d6-d4464b2ff80e/buildtargets/${{ matrix.target }}/builds \
2933
| jq '.[0].build' )
3034

0 commit comments

Comments
 (0)