Skip to content

Commit b9a741a

Browse files
committed
👔 Get version from git
1 parent d57a78f commit b9a741a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

.github/scripts/autoversioning.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ log_info "Fetching version"
8686
VERSION=$(python -c "import sys; sys.path.insert(0, '$REPO_ROOT/CPAC'); from info import __version__; print(__version__.split('+', 1)[0])")
8787
VERSION_FILE="$REPO_ROOT/version"
8888
if [[ -f "$VERSION_FILE" ]]; then
89-
OLD_VERSION=$(<"$VERSION_FILE")
89+
cd "$REPO_ROOT"
90+
OLD_VERSION=$(git show "$(git log --pretty=format:'%h' -n 1 -- version | tail -n 1)":version)
91+
cd "$START_DIR"
9092
else
9193
OLD_VERSION="<none>"
9294
fi

0 commit comments

Comments
 (0)