Skip to content

Commit 2a81375

Browse files
committed
ci(docker): de-dockerize version checks
1 parent 0b24fe6 commit 2a81375

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

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

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,45 @@ on:
88

99
permissions: {}
1010

11+
defaults:
12+
run:
13+
working-directory: aws-cli
14+
1115
jobs:
12-
pipx-check-versions:
16+
npm-check-versions:
1317
runs-on: ubuntu-latest
1418
steps:
15-
- name: Check the versions
19+
- name: Check out
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
with:
22+
persist-credentials: false
23+
- name: Set up Python
24+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
25+
with:
26+
python-version: 3.14
27+
- name: Check outdated dependencies
1628
shell: bash
1729
run: |
1830
set -euo pipefail
1931
IFS=$'\n\t'
20-
docker run --pull always -t --user root --entrypoint /bin/sh "leplusorg/${GITHUB_REPOSITORY#*/docker-}:main" -c 'if pipx upgrade-all --global | tee -a /dev/stderr | grep -q -e "^upgraded "; then exit 1; 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 | { \grep -e '^Available versions: ' || true; } | \cut -d ',' -f 1 | \sed -e 's/^.*: //')"
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)