Merge pull request #6578 from marc1706/ticket/17280

[ticket/17280] Fall back to branch when no valid title found
This commit is contained in:
Marc Alexander 2023-12-31 09:38:20 +01:00
commit 5a922ffa5b
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -34,6 +34,12 @@ then
ticket_id=$(sed -E 's/(ticket\/)(security\/)?([0-9]+)(.+$)?/\3/gm;t;d' <<< "$branch"); ticket_id=$(sed -E 's/(ticket\/)(security\/)?([0-9]+)(.+$)?/\3/gm;t;d' <<< "$branch");
branch_title=$(sed -E 's/(ticket\/)(security\/)?([0-9]+)(.+$)?/\1\2\3/gm;t;d' <<< "$branch"); branch_title=$(sed -E 's/(ticket\/)(security\/)?([0-9]+)(.+$)?/\1\2\3/gm;t;d' <<< "$branch");
# Fall back to branch name if no ticket ID
if [ -z "$branch_title" ];
then
branch_title="$branch";
fi
if [ "security/" = "$(sed -E 's/(ticket\/)(security\/)?([0-9]+)(.+$)?/\2/gm;t;d' <<< "$branch")" ]; if [ "security/" = "$(sed -E 's/(ticket\/)(security\/)?([0-9]+)(.+$)?/\2/gm;t;d' <<< "$branch")" ];
then then
tail="$(printf '\n\nSECURITY-%s' "$ticket_id")"; tail="$(printf '\n\nSECURITY-%s' "$ticket_id")";