Skip to content

Commit 12a99bd

Browse files
committed
ci(docker): de-dockerize version checks
1 parent a206c58 commit 12a99bd

File tree

1 file changed

+21
-3
lines changed

1 file changed

+21
-3
lines changed

.github/workflows/pipx-check-versions.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,24 @@ jobs:
2929
run: |
3030
set -euo pipefail
3131
IFS=$'\n\t'
32-
if pipx upgrade-all --global | tee -a /dev/stderr | grep -q -e "^upgraded " ; then
33-
exit 1
34-
fi
32+
rc=0
33+
# Read each line from requirements.txt
34+
while IFS= read -r line; do
35+
# Skip empty lines and comments
36+
if [[ -z "$line" || "$line" =~ ^# ]]; then
37+
continue
38+
fi
39+
# Extract package name and current version
40+
if [[ "$line" =~ ^([a-zA-Z0-9_-]+)==([0-9.]+) ]]; then
41+
package="${BASH_REMATCH[1]}"
42+
current_version="${BASH_REMATCH[2]}"
43+
# Get latest version from PyPI using pip index versions
44+
# The version in parentheses on the first line is the latest
45+
latest_version=$(\pip index versions "$package" 2>/dev/null | \head -1 | \sed -E 's/.*\(([0-9.]+)\).*/\1/' || echo "unknown")
46+
if [ "${current_version}" != "${latest_version}" ]; then
47+
echo "${package}: ${current_version} -> ${latest_version}"
48+
rc=$((rc+1))
49+
fi
50+
fi
51+
done < requirements.txt
52+
exit ${rc}

0 commit comments

Comments
 (0)