|
1 | 1 | name: Port to release branch |
2 | 2 |
|
3 | 3 | # Ports flagged commits from master onto release/X.Y branches: |
4 | | -# - trailer line in a commit message pushed to master; accepted forms: |
5 | | -# "Port: 1.5", "Port/1.5", "Port 1.5", "Port - 1.5", "Port: release/1.5" |
| 4 | +# - "port 1.5" flag in a commit message pushed to master — own line or |
| 5 | +# mid-line; separators : / - or space; "release/1.5" also accepted; |
| 6 | +# comma lists ("Port: 1.5, 1.4") work in the own-line form |
6 | 7 | # - "port release/1.5" label on a merged PR |
7 | 8 | # Conflicts are reported to the "Port status: <branch>" tracking issue. |
8 | 9 |
|
@@ -55,11 +56,16 @@ jobs: |
55 | 56 | # skip merge commits (handled by the label path) |
56 | 57 | [ "$(git rev-list --no-walk --count --min-parents=2 "$sha")" -eq 0 ] || continue |
57 | 58 |
|
58 | | - # extract targets, then keep only version-shaped ones (X.Y[.Z]) |
59 | | - targets=$(git log -1 --format=%B "$sha" | |
| 59 | + # own-line form (supports comma lists), validated version-shaped |
| 60 | + t1=$(git log -1 --format=%B "$sha" | |
60 | 61 | { grep -iE '^Port[:/ -]' || true; } | sed -E 's|^port[-:/ ]+||I' | tr ',' '\n' | |
61 | 62 | sed 's/[[:space:]]//g; /^$/d' | sed 's|^release/||I' | |
62 | | - { grep -E '^[0-9]+\.[0-9]+(\.[0-9]+)?$' || true; } | sort -u) |
| 63 | + { grep -E '^[0-9]+\.[0-9]+(\.[0-9]+)?$' || true; }) |
| 64 | + # mid-line form, e.g. "fix thing fixes #2802 port 1.5" |
| 65 | + t2=$(git log -1 --format=%B "$sha" | |
| 66 | + { grep -oiE '\bport[-: /]+(release/)?[0-9]+\.[0-9]+(\.[0-9]+)?\b' || true; } | |
| 67 | + sed -E 's|^port[-:/ ]+||I' | sed 's|^release/||I') |
| 68 | + targets=$(printf '%s\n%s\n' "$t1" "$t2" | sed '/^$/d' | sort -u) |
63 | 69 | for ver in $targets; do |
64 | 70 | echo "::group::port $sha -> release/$ver" |
65 | 71 | bash scripts/port.sh "release/$ver" "$sha" |
|
0 commit comments