Skip to content

Commit 5eac972

Browse files
authored
Fix branch name for merge-triggered workflow runs (#188)
1 parent d476436 commit 5eac972

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

.github/workflows/deploy-bundle-preview.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
exit 1
3535
fi
3636
}
37-
validate_branch_name "${{ github.event.pull_request.head.ref }}"
37+
validate_branch_name "${{ github.event.pull_request.head.ref || github.ref_name }}"
3838
3939
- name: Extract Branch Names
4040
id: extract_branch
@@ -53,7 +53,7 @@ jobs:
5353
}
5454
5555
# Transform branch names in form of `refs/heads/main` to `main`
56-
draft_branch=$(extract_branch "${{ github.event.pull_request.head.ref }}")
56+
draft_branch=$(extract_branch "${{ github.event.pull_request.head.ref || github.ref_name }}")
5757
5858
# Replace / with - in the draft branch name to use as a directory name
5959
draft_directory=$(echo "$draft_branch" | tr / -)

0 commit comments

Comments
 (0)