mirror of
https://github.com/status-im/nimbus-eth2.git
synced 2025-01-14 00:29:04 +00:00
fix branch check when bumping to commit outside of shallow range (#5349)
CI Lint check failed when bumping to a commit outside default shallow range. Deepen the checkout through the bumped commit date to ensure history is available for the ancestry check.
This commit is contained in:
parent
ffd4e7a024
commit
4d2fd8c2b6
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -218,16 +218,22 @@ jobs:
|
||||
run: |
|
||||
while read -r file; do
|
||||
commit="$(git -C "$file" rev-parse HEAD)"
|
||||
commit_date=$(git -C "$file" show -s --format='%ci' HEAD)
|
||||
if ! branch="$(git config -f .gitmodules --get "submodule.$file.branch")"; then
|
||||
echo "Submodule '$file': '.gitmodules' lacks 'branch' entry"
|
||||
exit 2
|
||||
fi
|
||||
if ! error="$(git -C "$file" fetch -q origin "+refs/heads/$branch:refs/remotes/origin/$branch")"; then
|
||||
# Without the `--depth=1` fetch, may run into 'error processing shallow info: 4'
|
||||
if ! error="$(git -C "$file" fetch -q --depth=1 origin "+refs/heads/${branch}:refs/remotes/origin/${branch}")"; then
|
||||
echo "Submodule '$file': Failed to fetch '$branch': $error"
|
||||
exit 2
|
||||
fi
|
||||
if ! error="$(git -C "$file" fetch -q --shallow-since="$commit_date" origin "+refs/heads/${branch}:refs/remotes/origin/${branch}")"; then
|
||||
echo "Submodule '$file': Failed to fetch '$branch': $error"
|
||||
exit 2
|
||||
fi
|
||||
if ! git -C "$file" merge-base --is-ancestor "$commit" "refs/remotes/origin/$branch"; then
|
||||
echo "Submodule '$file': '$commit' is not on '$branch'"
|
||||
echo "Submodule '$file': '$commit' is not on '$branch' as of '$commit_date' (branch config: '.gitmodules')"
|
||||
exit 2
|
||||
fi
|
||||
done < <(git diff --name-only --diff-filter=AM HEAD^ HEAD | grep -f <(git config --file .gitmodules --get-regexp path | awk '{ print $2 }') || true)
|
||||
|
Loading…
x
Reference in New Issue
Block a user