Skip to content

Commit 2f97a88

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 2f97a88

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
#We don't have to build the kernel here, as we have a cron job running on
1818
#the k8s cluster that builds the linus-master target nightly.
1919
- name: Run blktests in VM
20+
id: blktests
2021
uses: ./.github/actions/kubevirt-action
2122
with:
2223
kernel_version: linus-master
@@ -51,6 +52,7 @@ jobs:
5152
5253
git clone https://github.com/${{ github.repository }} nvme-cli
5354
cd nvme-cli
55+
git checkout ${{ github.sha }}
5456
scripts/build.sh -b release -c gcc
5557
sudo meson install -C .build-ci
5658
sudo ldconfig /usr/local/lib64
@@ -72,6 +74,7 @@ jobs:
7274
EF
7375
sudo ./check nvme md/001
7476
- name: Run nvme-cli tests in VM
77+
if: success() || steps.blktests.conclusion == 'failure'
7578
uses: ./.github/actions/kubevirt-action
7679
with:
7780
kernel_version: linus-master
@@ -86,7 +89,9 @@ jobs:
8689
uname -a
8790
PIPX_BIN_DIR=/usr/local/bin pipx install nose2 --force
8891
git clone https://github.com/${{ github.repository }} /nvme-cli
92+
git config --global --add safe.directory /nvme-cli
8993
cd /nvme-cli
94+
git checkout ${{ github.sha }}
9095
scripts/build.sh -b release -c gcc
9196
CONTROLLER=$(echo "${BDEV0}" | sed 's/n[0-9]*$//')
9297
cat > tests/config.json << EOJ

0 commit comments

Comments
 (0)