mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-07-05 19:47:53 +00:00
Merge pull request #10992 from microsoft/danmihai1/git-helper
gha: always delete workspace on rebase error
This commit is contained in:
commit
014ff8476a
@ -17,15 +17,11 @@ function add_kata_bot_info() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function rebase_atop_of_the_latest_target_branch() {
|
function rebase_atop_of_the_latest_target_branch() {
|
||||||
if [ -n "${TARGET_BRANCH}" ]; then
|
if [[ -n "${TARGET_BRANCH}" ]]; then
|
||||||
echo "Rebasing atop of the latest ${TARGET_BRANCH}"
|
echo "Rebasing atop of the latest ${TARGET_BRANCH}"
|
||||||
# Recover from any previous rebase left halfway
|
if ! git rebase "origin/${TARGET_BRANCH}"; then
|
||||||
git rebase --abort 2> /dev/null || true
|
if [[ -n "${GITHUB_WORKSPACE}" ]] ; then
|
||||||
if ! git rebase origin/${TARGET_BRANCH}; then
|
echo "Rebase failed, cleaning up the local repository and exiting"
|
||||||
# if GITHUB_WORKSPACE is defined and an architecture is not equal to x86_64
|
|
||||||
# (mostly self-hosted runners), then remove the repository
|
|
||||||
if [ -n "${GITHUB_WORKSPACE}" ] && [ "$(uname -m)" != "x86_64" ]; then
|
|
||||||
echo "Rebase failed, cleaning up a repository for self-hosted runners and exiting"
|
|
||||||
cd "${GITHUB_WORKSPACE}"/..
|
cd "${GITHUB_WORKSPACE}"/..
|
||||||
sudo rm -rf "${GITHUB_WORKSPACE}"
|
sudo rm -rf "${GITHUB_WORKSPACE}"
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user