Skip to content

Commit

Permalink
Fix Pypi release version error (#163)
Browse files Browse the repository at this point in the history
* Fix Pypi release version error

Due to recent Git security feature: https://github.blog/2022-04-12-git-security-vulnerability-announced/, Git requires repository folder to be owned and accessed by the same user, or add the folder to safe directory, otherwise, git commands cannot be successfully executed and thus the correct PECOS version could not be retrieved.

* Add extra git command checks
  • Loading branch information
weiliw-amz authored Aug 8, 2022
1 parent 1243b21 commit 3fadc0a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .github/build_pypi_wheel.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/bin/bash
set -e

# Git requires repository folder to be owned and accessed by the same user, or add the folder to safe directory
# Otherwise, git commands cannot be successfully executed and thus correct PECOS version could not be retrieved
# See: https://github.blog/2022-04-12-git-security-vulnerability-announced/
git config --global --add safe.directory /$DOCKER_MNT
PECOS_TAG=$(cd $DOCKER_MNT && git describe --tags --abbrev=0)
echo "Building wheel for PECOS $PECOS_TAG..."

# Get pip
echo "Build wheel using Python version $PIP_VER..."
PIP=$(ls /opt/python/cp${PIP_VER//./}-cp*/bin/pip)
Expand Down

0 comments on commit 3fadc0a

Please sign in to comment.