From 8d34c36fef4adb23ba743c588af75bb2c5117d01 Mon Sep 17 00:00:00 2001 From: Mert Ekren Date: Tue, 26 Nov 2024 11:46:09 +0300 Subject: [PATCH] ci: workflows: remove rebase-merge folder before rebase With gitv2.26, git rebase uses "git merge" mechanism instead of "git apply". This creates a rebase-merge folder in .git, in case of rebase conflict. This caused problems in self hosted runners due to old rebase-merge folder. This commit deletes this folder before git rebase action. Signed-off-by: Mert Ekren --- .github/workflows/bsim-tests.yaml | 1 + .github/workflows/clang.yaml | 1 + .github/workflows/coding_guidelines.yml | 2 ++ .github/workflows/compliance.yml | 2 ++ .github/workflows/doc-build.yml | 2 ++ .github/workflows/hello_world_multiplatform.yaml | 2 ++ .github/workflows/scripts_tests.yml | 2 ++ .github/workflows/twister-prep.yaml | 1 + .github/workflows/twister.yaml | 1 + 9 files changed, 14 insertions(+) diff --git a/.github/workflows/bsim-tests.yaml b/.github/workflows/bsim-tests.yaml index 4739f99e68b194..2b5592b65272c6 100644 --- a/.github/workflows/bsim-tests.yaml +++ b/.github/workflows/bsim-tests.yaml @@ -77,6 +77,7 @@ jobs: git config --global user.email "bot@zephyrproject.org" git config --global user.name "Zephyr Bot" rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d git log --pretty=oneline | head -n 10 diff --git a/.github/workflows/clang.yaml b/.github/workflows/clang.yaml index 0d97ecc8abcade..c8da74ee317996 100644 --- a/.github/workflows/clang.yaml +++ b/.github/workflows/clang.yaml @@ -61,6 +61,7 @@ jobs: git config --global user.email "bot@zephyrproject.org" git config --global user.name "Zephyr Bot" rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d git log --pretty=oneline | head -n 10 diff --git a/.github/workflows/coding_guidelines.yml b/.github/workflows/coding_guidelines.yml index 97d2301a9e3c91..952056aa4da7e4 100644 --- a/.github/workflows/coding_guidelines.yml +++ b/.github/workflows/coding_guidelines.yml @@ -40,6 +40,8 @@ jobs: git config --global user.email "actions@zephyrproject.org" git config --global user.name "Github Actions" git remote -v + rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d source zephyr-env.sh diff --git a/.github/workflows/compliance.yml b/.github/workflows/compliance.yml index ecd874dd4869b9..3795101a9b2778 100644 --- a/.github/workflows/compliance.yml +++ b/.github/workflows/compliance.yml @@ -33,6 +33,8 @@ jobs: # Ensure there's no merge commits in the PR [[ "$(git rev-list --merges --count origin/${BASE_REF}..)" == "0" ]] || \ (echo "::error ::Merge commits not allowed, rebase instead";false) + rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d # debug diff --git a/.github/workflows/doc-build.yml b/.github/workflows/doc-build.yml index 7564d163f81d5a..04a114195bbfcd 100644 --- a/.github/workflows/doc-build.yml +++ b/.github/workflows/doc-build.yml @@ -94,6 +94,8 @@ jobs: run: | git config --global user.email "actions@zephyrproject.org" git config --global user.name "Github Actions" + rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d git log --graph --oneline HEAD...${PR_HEAD} diff --git a/.github/workflows/hello_world_multiplatform.yaml b/.github/workflows/hello_world_multiplatform.yaml index 605cc2a903b695..f654ec71ab0930 100644 --- a/.github/workflows/hello_world_multiplatform.yaml +++ b/.github/workflows/hello_world_multiplatform.yaml @@ -45,6 +45,8 @@ jobs: run: | git config --global user.email "actions@zephyrproject.org" git config --global user.name "Github Actions" + rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d git log --graph --oneline HEAD...${PR_HEAD} diff --git a/.github/workflows/scripts_tests.yml b/.github/workflows/scripts_tests.yml index 183f3eb474be0b..2889785a3275e9 100644 --- a/.github/workflows/scripts_tests.yml +++ b/.github/workflows/scripts_tests.yml @@ -42,6 +42,8 @@ jobs: run: | git config --global user.email "actions@zephyrproject.org" git config --global user.name "Github Actions" + rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d git log --graph --oneline HEAD...${PR_HEAD} diff --git a/.github/workflows/twister-prep.yaml b/.github/workflows/twister-prep.yaml index 4c8b03a5418b69..51bc771059d695 100644 --- a/.github/workflows/twister-prep.yaml +++ b/.github/workflows/twister-prep.yaml @@ -67,6 +67,7 @@ jobs: git config --global user.email "bot@zephyrproject.org" git config --global user.name "Zephyr Bot" rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d git log --pretty=oneline | head -n 10 diff --git a/.github/workflows/twister.yaml b/.github/workflows/twister.yaml index 0fa810b3dd7654..f29d690dd83f61 100644 --- a/.github/workflows/twister.yaml +++ b/.github/workflows/twister.yaml @@ -84,6 +84,7 @@ jobs: git config --global user.email "bot@zephyrproject.org" git config --global user.name "Zephyr Builder" rm -fr ".git/rebase-apply" + rm -fr ".git/rebase-merge" git rebase origin/${BASE_REF} git clean -f -d git log --pretty=oneline | head -n 10