mirror of
https://github.com/flatcar/scripts.git
synced 2025-09-22 14:11:07 +02:00
.github: check for remote branches with git ls-remote
git show-ref in check_remote_branch is not working at all, because the GitHub Actions checkout fetches a git repo with only depth 1 by default. That means only main branch is available, not any other remote branches. As a result, git show-ref always fails. Fix that by checking for remote branches by git ls-remote.
This commit is contained in:
parent
6d31354e9f
commit
c4a99b4376
3
.github/workflows/common.sh
vendored
3
.github/workflows/common.sh
vendored
@ -66,8 +66,7 @@ function prepare_git_repo() {
|
|||||||
|
|
||||||
function check_remote_branch() {
|
function check_remote_branch() {
|
||||||
local target_branch="${1}"
|
local target_branch="${1}"
|
||||||
|
if git -C "${SDK_OUTER_TOPDIR}" ls-remote --refs --heads --exit-code origin "${target_branch}" >/dev/null; then
|
||||||
if git -C "${SDK_OUTER_TOPDIR}" show-ref "remotes/origin/${target_branch}"; then
|
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
|
Loading…
x
Reference in New Issue
Block a user