diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 8ec7f6f62094ec7aa385c217756b9a847f4ee111..43fa5520c87897d29dc0654df27884172172dd9e 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -45,7 +45,7 @@ jobs:
         node-version: '12.x'
     - name: Extract branch name
       shell: bash
-      run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
+      run: echo "##[set-output name=branch;]$(echo ${GITHUB_HEAD_REF#refs/heads/})"
       id: extract_branch
 
     - run: npm install