@@ -427,45 +427,43 @@ jobs:
427427 run : |
428428 set -euo pipefail; echo "now: $(date -u +"%Y-%m-%dT%H:%M:%S.%3N")"
429429
430- pick="$(
431- python -c "
432- import re
433- import sys
434- import os
435-
436- # Read newline-delimited refs from env (robust against quoting)
437- tags = [t.strip() for t in os.environ['TAGS'].splitlines() if t.strip()]
438- # Filter out 'latest' tag
439- filtered = [t for t in tags if not t.endswith(':latest')]
440-
441- def tag_part(ref: str) -> str:
442- return ref.rsplit(':', 1)[-1]
443-
444- def first_match(rx: str):
445- # NOTE: matching only the tag part
446- pat = re.compile(rx)
447- for ref in filtered:
448- if pat.search(tag_part(ref)):
449- return ref
450- return None
451-
452- pick = (
453- first_match(r'^[vV]?\\d+\\.\\d+\\.\\d+$') # full semver X.Y.Z (opt. v-prefix)
454- or first_match(r'^.+-[0-9a-f]{7}$') # branch-SHA (7-char hex)
455- or first_match(r'^[vV]?\\d+\\.\\d+$') # X.Y (opt. v-prefix)
456- or first_match(r'^[vV]?\\d+$') # X (opt. v-prefix)
457- or (filtered[0] if filtered else None) # fallback
458- )
459-
460- if not pick:
461- print('::error::Could not select a tag from generated list:', file=sys.stderr)
462- for t in tags:
463- print(t, file=sys.stderr)
464- sys.exit(1)
465- else:
466- print(pick)
467- "
468- )"
430+ pick="$(python -c "
431+ import re
432+ import sys
433+ import os
434+
435+ # Read newline-delimited refs from env (robust against quoting)
436+ tags = [t.strip() for t in os.environ['TAGS'].splitlines() if t.strip()]
437+ # Filter out 'latest' tag
438+ filtered = [t for t in tags if not t.endswith(':latest')]
439+
440+ def tag_part(ref: str) -> str:
441+ return ref.rsplit(':', 1)[-1]
442+
443+ def first_match(rx: str):
444+ # NOTE: matching only the tag part
445+ pat = re.compile(rx)
446+ for ref in filtered:
447+ if pat.search(tag_part(ref)):
448+ return ref
449+ return None
450+
451+ pick = (
452+ first_match(r'^[vV]?\\d+\\.\\d+\\.\\d+$') # full semver X.Y.Z (opt. v-prefix)
453+ or first_match(r'^.+-[0-9a-f]{7}$') # branch-SHA (7-char hex)
454+ or first_match(r'^[vV]?\\d+\\.\\d+$') # X.Y (opt. v-prefix)
455+ or first_match(r'^[vV]?\\d+$') # X (opt. v-prefix)
456+ or (filtered[0] if filtered else None) # fallback
457+ )
458+
459+ if not pick:
460+ print('::error::Could not select a tag from generated list:', file=sys.stderr)
461+ for t in tags:
462+ print(t, file=sys.stderr)
463+ sys.exit(1)
464+ else:
465+ print(pick)
466+ ")"
469467
470468 echo "Selected for CVMFS: ${pick}"
471469 echo "tag=${pick}" >> "$GITHUB_OUTPUT"
0 commit comments