workflows: linting: Fix shellcheck SC2015

> A && B || C is not if-then-else. C may run when A is true

Refactor the echo so that we can't get into a situation where
the retry of workspace delete happens if the original one was
successful

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
stevenhorsman
2024-12-06 11:28:59 +00:00
parent c2ba15c111
commit 5d7c5bdfa4

View File

@@ -50,7 +50,7 @@ jobs:
- name: Adjust a permission for repo
run: |
sudo chown -R "$USER":"$USER" "$GITHUB_WORKSPACE" "$HOME"
sudo rm -rf "$GITHUB_WORKSPACE"/* && echo "GITHUB_WORKSPACE removed" || { sleep 10 && sudo rm -rf "$GITHUB_WORKSPACE"/*; }
sudo rm -rf "$GITHUB_WORKSPACE"/* || { sleep 10 && sudo rm -rf "$GITHUB_WORKSPACE"/*; }
sudo rm -f /tmp/kata_hybrid* # Sometime we got leftover from test_setup_hvsock_failed()
- name: Checkout the code