Skip to content

Commit 6f24ebd

Browse files
committed
add explicit GITHUB_BRANCH_NAME - PR is working on a detached commit
1 parent aafe571 commit 6f24ebd

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

.github/workflows/preview.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
env:
1111
PREVIEW_HOSTNAME: ep-preview.click
12+
GITHUB_BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
1213

1314
steps:
1415
- name: Checkout
@@ -41,7 +42,7 @@ jobs:
4142

4243
- name: Get current branch name
4344
run: |
44-
BRANCH_NAME=$(make safe_branch)
45+
BRANCH_NAME=$(make safe_branch BRANCH=$GITHUB_BRANCH_NAME)
4546
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV
4647
4748
- name: ssh keyscan

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export GIT_VERSION ?= $(shell git rev-parse --short HEAD)
1515
# Variables for deploy
1616
# ====================
1717
# Auto-detect and sanitize current git branch
18-
BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
18+
BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
1919
# Replace "/" and other non-alphanumeric characters with "-"
2020
SAFE_BRANCH := $(shell echo "$(BRANCH)" | sed 's/[^A-Za-z0-9._-]/-/g')
2121
FORCE_DEPLOY ?= false

0 commit comments

Comments
 (0)