From 41e52f9e2e4c551e3d97afdea9b031e744ffe2ff Mon Sep 17 00:00:00 2001 From: Ronnie Miller Date: Fri, 14 Mar 2025 15:23:58 -0700 Subject: [PATCH] Fix branch name for merge-triggered workflow runs --- .github/workflows/deploy-bundle-preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-bundle-preview.yml b/.github/workflows/deploy-bundle-preview.yml index 69d3f7f7..d165456c 100644 --- a/.github/workflows/deploy-bundle-preview.yml +++ b/.github/workflows/deploy-bundle-preview.yml @@ -34,7 +34,7 @@ jobs: exit 1 fi } - validate_branch_name "${{ github.event.pull_request.head.ref }}" + validate_branch_name "${{ github.event.pull_request.head.ref || github.ref_name }}" - name: Extract Branch Names id: extract_branch @@ -53,7 +53,7 @@ jobs: } # Transform branch names in form of `refs/heads/main` to `main` - draft_branch=$(extract_branch "${{ github.event.pull_request.head.ref }}") + draft_branch=$(extract_branch "${{ github.event.pull_request.head.ref || github.ref_name }}") # Replace / with - in the draft branch name to use as a directory name draft_directory=$(echo "$draft_branch" | tr / -)