Skip to content

Commit

Permalink
Fix AUTHOR check in uv-sync
Browse files Browse the repository at this point in the history
  • Loading branch information
win845 committed Nov 19, 2024
1 parent 55ba993 commit ae4deee
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions bin/uv-sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ BRANCH_NAME=${GITHUB_REF#refs/heads/}
AUTHOR_NAME=$(git log -1 --pretty=format:"%an")
AUTHOR_EMAIL=$(git log -1 --pretty=format:"%ae")

if [[ "$AUTHOR" == *dependabot* ]] ; then
if [[ "$AUTHOR_NAME" == *dependabot* ]] ; then
# Read requirements.txt, exclude comments, and format as TOML array
constraints=$(grep -vE '^\s*#' requirements.txt | awk '{print " \""$0"\","}')

# Append constraint-dependencies to pyproject.toml
cat << EOF >> pyproject.toml
cat <<EOF >> pyproject.toml
[tool.uv]
constraint-dependencies = [
Expand Down Expand Up @@ -42,8 +42,9 @@ EOF

git add uv.lock requirements.txt
if ! git diff --cached --quiet; then
git config --global user.name "$AUTHOR_NAME"
git config --global user.email "$AUTHOR_EMAIL"
git commit -m "Sync uv.lock and requirements.txt"
git push origin $BRANCH_NAME
# git config --global user.name "$AUTHOR_NAME"
# git config --global user.email "$AUTHOR_EMAIL"
# git commit -m "Sync uv.lock and requirements.txt"
# git push origin $BRANCH_NAME
echo "push changes"
fi

0 comments on commit ae4deee

Please sign in to comment.