File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,25 +33,25 @@ jobs:
3333
3434 # Pick the file with the highest YYMM version.
3535 # Only considers files whose names start with 4 digits (e.g. 2604.wcp, 2508.1.wcp).
36- LATEST=$(python3 - <<'EOF'
37- import sys, json, re
38-
39- data = json.loads(sys.stdin.read())
40- files = [f["name"] for f in data if f["type"] == "file" and f["name"].endswith(".wcp")]
41-
42- best = None
43- best_ver = (-1, -1)
44- for name in files:
45- m = re.match(r'^(\d{4})(?:\.(\d+))?\.wcp$', name)
46- if m:
47- ver = (int(m.group(1)), int(m.group(2) or 0))
48- if ver > best_ver:
49- best_ver = ver
50- best = name
51-
52- print(best or "")
53- EOF
54- <<< "$RESPONSE" )
36+ LATEST=$(echo "$RESPONSE" | python3 - <<'EOF'
37+ import sys, json, re
38+
39+ data = json.loads(sys.stdin.read())
40+ files = [f["name"] for f in data if f["type"] == "file" and f["name"].endswith(".wcp")]
41+
42+ best = None
43+ best_ver = (-1, -1)
44+ for name in files :
45+ m = re.match(r'^(\d{4})(?:\.(\d+))?\.wcp$', name)
46+ if m :
47+ ver = (int(m.group(1)), int(m.group(2) or 0))
48+ if ver > best_ver :
49+ best_ver = ver
50+ best = name
51+
52+ print(best or "")
53+ EOF
54+ )
5555
5656 if [[ -z "$LATEST" ]]; then
5757 echo "Could not determine latest .wcp file." >&2
You can’t perform that action at this time.
0 commit comments