Skip to content

Commit 74d9994

Browse files
committed
[SDK-131] Add checkout of avatar loader branch (#67)
- This update the pr-template with dependency - avatar loader branch - Also updates test runner to checkout defined avatar loader branch in PR. - Test runner action to checkout avatar loader specified branch
1 parent fc71795 commit 74d9994

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

.github/pull_request_template.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@
55

66
## [TICKETID](https://ready-player-me.atlassian.net/browse/TICKETID)
77

8+
<!-- Replace the branch with the dependency, if no dependency is required than set this to develop -->
9+
## Dependencies
10+
```Package
11+
Avatar Loader: branch
12+
```
13+
814
## Description
915

1016
- Briefly describe what this change will do

.github/workflows/pr-test-runner.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,47 @@ jobs:
2727
fetch-depth: 0
2828
ref: develop
2929
token: ${{ secrets.DEV_SDK_TOKEN }}
30+
31+
- name: Get PR dependencies
32+
id: pr-dependencies
33+
run: |
34+
PR_DEPENDENCY=$(awk -v start="\`\`\`Package" -v end="\`\`\`" '{
35+
if ($0 ~ start) {p=1; next}
36+
if (p && !($0 ~ end)) {print}
37+
if ($0 ~ end) {p=0}
38+
}' <<\EOF
39+
${{ github.event.pull_request.body }}
40+
EOF
41+
)
42+
echo "dependency=$PR_DEPENDENCY" >> "$GITHUB_OUTPUT"
3043
- name: Checkout submodule branch
3144
run: |
32-
cd ${{ secrets.CORE_PATH }}
45+
cd Assets/Ready\ Player\ Me/Core
3346
git fetch -a
3447
git checkout ${{ github.event.pull_request.head.ref }}
3548
git pull origin ${{ github.event.pull_request.head.ref }}
36-
49+
50+
dependency="${{ steps.pr-dependencies.outputs.dependency }}"
51+
if [ -z "$dependency" ]; then
52+
echo "No dependency found in PR description"
53+
exit 0
54+
fi
55+
echo "Dependencies found - ${dependency}"
56+
57+
AVATAR_LOADER_BRANCH="${dependency#*Avatar Loader: }"
58+
AVATAR_LOADER_BRANCH=$(echo "$AVATAR_LOADER_BRANCH" | tr -d '\r')
59+
60+
cd ../Avatar\ Loader
61+
git fetch -a
62+
git checkout "$AVATAR_LOADER_BRANCH"
63+
64+
if [ $? -ne 0 ]; then
65+
echo "Avatar loader checkout failed, no branch found with name $AVATAR_LOADER_BRANCH"
66+
exit 0
67+
fi
68+
69+
git pull origin "$AVATAR_LOADER_BRANCH"
70+
3771
- name: Cache Project
3872
uses: actions/cache@v3
3973
with:

0 commit comments

Comments
 (0)