Created
September 22, 2023 16:08
-
-
Save aristidesneto/6cac19d4e223afd83ff07c2b8633d6a1 to your computer and use it in GitHub Desktop.
Revisions
-
aristidesneto created this gist
Sep 22, 2023 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,9 @@ #!/bin/bash BRANCH_NAME=$(git symbolic-ref --short HEAD) TICKET="${BRANCH_NAME##*/}" EXP='^[0-9]+$' if [ -n "$BRANCH_NAME" ] && [[ $TICKET =~ $EXP ]]; then sed -i.bak -e "1s/^/[ DSO-$TICKET ] - /" $1 fi