diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh index 374ff0f919..79e1fa0d9f 100644 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/common.sh @@ -31,6 +31,14 @@ function get_ebuild_filename() { fi } +function prepare_git_repo() { + git config user.name "${BUILDBOT_USERNAME}" + git config user.email "${BUILDBOT_USEREMAIL}" + git reset --hard HEAD + git fetch origin + git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" +} + # caller needs to set pass a parameter as a branch name to be created. function checkout_branches() { TARGET_BRANCH=$1 @@ -81,11 +89,6 @@ function generate_patches() { } function apply_patches() { - git config user.name "${BUILDBOT_USERNAME}" - git config user.email "${BUILDBOT_USEREMAIL}" - git reset --hard HEAD - git fetch origin - git checkout -B "${BASE_BRANCH}" "origin/${BASE_BRANCH}" git am "${SDK_OUTER_SRCDIR}"/third_party/coreos-overlay/0*.patch rm -f "${SDK_OUTER_SRCDIR}"/third_party/coreos-overlay/0*.patch } diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh index ab0906c95c..423083f5e6 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/containerd-apply-patch.sh @@ -6,6 +6,8 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh +prepare_git_repo + if ! checkout_branches "containerd-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh index 9e53c16e0f..04bea94f4f 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/docker-apply-patch.sh @@ -6,6 +6,8 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh +prepare_git_repo + if ! checkout_branches "docker-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-apply-patch.sh index dbb354f153..1cfb8fcfae 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/firmware-apply-patch.sh @@ -6,6 +6,8 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh +prepare_git_repo + if ! checkout_branches "${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh index 3c77618730..d60076d50f 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/go-apply-patch.sh @@ -8,6 +8,8 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh +prepare_git_repo + if ! checkout_branches "go-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh index bb699ae73e..34cb256cc2 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/kernel-apply-patch.sh @@ -8,6 +8,8 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh +prepare_git_repo + if ! checkout_branches "linux-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh index 9ad7a60987..fd90a7d278 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/runc-apply-patch.sh @@ -6,6 +6,8 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh +prepare_git_repo + if ! checkout_branches "runc-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0 diff --git a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh index f5f646f819..1a740850c6 100755 --- a/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh +++ b/sdk_container/src/third_party/coreos-overlay/.github/workflows/rust-apply-patch.sh @@ -6,6 +6,8 @@ UPDATE_NEEDED=1 . .github/workflows/common.sh +prepare_git_repo + if ! checkout_branches "rust-${VERSION_NEW}-${TARGET}"; then UPDATE_NEEDED=0 exit 0