Skip to content

Commit b67d051

Browse files
committed
[build] Dynamically set OPENRNDR branch based on workflow branch
1 parent 2d7872d commit b67d051

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,24 @@ jobs:
2121
path: ./orx
2222

2323
- name: Checkout OPENRNDR repository
24+
run: |
25+
BRANCH_NAME=${{ github.head_ref || github.ref_name }}
26+
echo "Checking for branch $BRANCH_NAME in openrndr/openrndr"
27+
if git ls-remote --exit-code --heads https://github.com/openrndr/openrndr.git "$BRANCH_NAME" > /dev/null; then
28+
echo "Branch $BRANCH_NAME found in openrndr/openrndr"
29+
echo "OPENRNDR_BRANCH=$BRANCH_NAME" >> $GITHUB_ENV
30+
else
31+
echo "Branch $BRANCH_NAME not found in openrndr/openrndr, falling back to master"
32+
echo "OPENRNDR_BRANCH=master" >> $GITHUB_ENV
33+
fi
34+
working-directory: .
35+
36+
- name: Checkout OPENRNDR
2437
uses: actions/checkout@v6
2538
with:
2639
fetch-depth: 0
2740
repository: openrndr/openrndr
41+
ref: ${{ env.OPENRNDR_BRANCH }}
2842
path: ./openrndr
2943

3044
- name: Test glxinfo

0 commit comments

Comments
 (0)