From 055706dbdf048cbc5ea5e0e8001d724d62331f77 Mon Sep 17 00:00:00 2001 From: Pranav Gaikwad Date: Sat, 30 Mar 2024 13:50:22 -0400 Subject: [PATCH] :ghost: workflow should use correct addon branch Signed-off-by: Pranav Gaikwad --- .github/workflows/demo-testing.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/demo-testing.yml b/.github/workflows/demo-testing.yml index 1d4b95bc..75d28cc2 100644 --- a/.github/workflows/demo-testing.yml +++ b/.github/workflows/demo-testing.yml @@ -11,7 +11,13 @@ jobs: echo "${{ github.event.pull_request.body }}" PULL_REQUEST_NUMBER=$(echo "${{ github.event.pull_request.body }}" | grep -oP 'Addon PR: \K\d+' || true) if [ -z "$PULL_REQUEST_NUMBER" ]; then - echo "ADDON_REF=main" >>$GITHUB_ENV + if [ -z "${{ github.event.pull_request.base.ref }}" ]; then + echo "Using addon branch main" + echo "ADDON_REF=main" >>$GITHUB_ENV + else + echo "Using addon branch ${{ github.event.pull_request.base.ref }}" + echo "ADDON_REF=${{ github.event.pull_request.base.ref }}" >>$GITHUB_ENV + fi else echo "ADDON_REF=refs/pull/$PULL_REQUEST_NUMBER/merge" >>$GITHUB_ENV fi