Skip to content

Commit

Permalink
Merge branch 'ko3n1g/ci/check-git-version' into 'main'
Browse files Browse the repository at this point in the history
ci: Check git-version for autoformat.sh

See merge request ADLR/megatron-lm!2032
  • Loading branch information
ko3n1g committed Sep 3, 2024
2 parents 42e9b0e + 8cdc780 commit 27289dc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tools/autoformat.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
#!/bin/bash
set -euox pipefail

GIT_VERSION=$(git version | awk '{print $3}')
GIT_MAJOR=$(echo $GIT_VERSION | awk -F. '{print $1}')
GIT_MINOR=$(echo $GIT_VERSION | awk -F. '{print $2}')

if [[ $GIT_MAJOR -eq 2 && $GIT_MINOR -lt 31 ]]; then
echo "Git version must be at least 2.31.0. Found $GIT_VERSION"
exit 1
fi

SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
CHECK_ONLY=${CHECK_ONLY:-false}
SKIP_DOCS=${SKIP_DOCS:-false}
Expand Down

0 comments on commit 27289dc

Please sign in to comment.