Skip to content

Commit 00960d4

Browse files
committed
CI: checkout commit that triggered the workflow
Until now we always checked out the default branch. Since we now allow workflow dispatches on forks this does not make sense anymore, and we should rather checkout the commit that triggered the workflow. Signed-off-by: Dennis Maisenbacher <[email protected]>
1 parent 5d8902a commit 00960d4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

.github/workflows/run-nightly-tests.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ jobs:
5151
5252
git clone https://github.com/${{ github.repository }} nvme-cli
5353
cd nvme-cli
54+
git checkout ${{ github.sha }}
5455
scripts/build.sh -b release -c gcc
5556
sudo meson install -C .build-ci
5657
sudo ldconfig /usr/local/lib64
@@ -72,6 +73,7 @@ jobs:
7273
EF
7374
sudo ./check nvme md/001
7475
- name: Run nvme-cli tests in VM
76+
if: always()
7577
uses: ./.github/actions/kubevirt-action
7678
with:
7779
kernel_version: linus-master
@@ -86,7 +88,9 @@ jobs:
8688
uname -a
8789
PIPX_BIN_DIR=/usr/local/bin pipx install nose2 --force
8890
git clone https://github.com/${{ github.repository }} /nvme-cli
91+
git config --global --add safe.directory /nvme-cli
8992
cd /nvme-cli
93+
git checkout ${{ github.sha }}
9094
scripts/build.sh -b release -c gcc
9195
CONTROLLER=$(echo "${BDEV0}" | sed 's/n[0-9]*$//')
9296
cat > tests/config.json << EOJ

0 commit comments

Comments
 (0)