Skip to content

Commit c9cf5fb

Browse files
author
rahul-infra
committed
check git ref.
1 parent 3b878d8 commit c9cf5fb

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/release-preview.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,17 @@ jobs:
6666
id: semantic
6767
env:
6868
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
# Override GitHub's environment variables to make semantic-release see the actual PR branch
70-
GITHUB_REF: refs/heads/${{ github.event.pull_request.head.ref }}
71-
GITHUB_REF_NAME: ${{ github.event.pull_request.head.ref }}
72-
GITHUB_HEAD_REF: ""
7369
run: |
70+
# Unset GitHub Actions environment variables that interfere with semantic-release
71+
unset GITHUB_REF
72+
unset GITHUB_REF_NAME
73+
unset GITHUB_HEAD_REF
74+
unset GITHUB_BASE_REF
75+
76+
# Set them to what we want
77+
export GITHUB_REF="refs/heads/${{ github.event.pull_request.head.ref }}"
78+
export GITHUB_REF_NAME="${{ github.event.pull_request.head.ref }}"
79+
7480
echo "=== Debug Info ==="
7581
echo "Expected branch: ${{ github.event.pull_request.head.ref }}"
7682
echo "Current git branch: $(git branch --show-current)"

0 commit comments

Comments
 (0)