Skip to content

Commit 839f117

Browse files
committed
actions BUGFIX branch detection
1 parent ab9deb6 commit 839f117

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,12 @@ jobs:
117117
${{ matrix.config.packager }} update
118118
${{ matrix.config.packager }} install $DEFAULT_PACKAGES ${{ matrix.config.packages }}
119119
120-
GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
120+
if ${{ github.event_name == 'push' }}
121+
then GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
122+
else
123+
GIT_BRANCH=${{ github.base_ref }}
124+
fi
125+
121126
git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
122127
cd libyang
123128
mkdir build
@@ -164,7 +169,12 @@ jobs:
164169
sudo apt-get install $DEFAULT_PACKAGES abi-dumper abi-compliance-checker
165170
sudo snap install core universal-ctags
166171
167-
GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
172+
if ${{ github.event_name == 'push' }}
173+
then GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
174+
else
175+
GIT_BRANCH=${{ github.base_ref }}
176+
fi
177+
168178
git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
169179
cd libyang
170180
mkdir build
@@ -204,7 +214,12 @@ jobs:
204214
sudo apt-get update
205215
sudo apt-get install $DEFAULT_PACKAGES lcov
206216
207-
GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
217+
if ${{ github.event_name == 'push' }}
218+
then GIT_BRANCH=`echo ${{ github.ref }} | cut -d'/' -f 3`
219+
else
220+
GIT_BRANCH=${{ github.base_ref }}
221+
fi
222+
208223
git clone -b $GIT_BRANCH https://github.com/CESNET/libyang.git
209224
cd libyang
210225
mkdir build

0 commit comments

Comments
 (0)