diff --git a/README.md b/README.md index 9d98291..6671543 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,3 @@ # create_listmonk_campaign -create a listmonk campaign if the name of the branch being merged includes "post_XXXXXX" +create a listmonk campaign if the name of the branch being merged includes "___post___XXXXXX" diff --git a/action.sh b/action.sh index 62a6ba9..8e6fd24 100755 --- a/action.sh +++ b/action.sh @@ -1 +1,7 @@ -echo $(git rev-parse --abbrev-ref HEAD) +#!/bin/bash +commit_subject=$(git log -1 --pretty=format:%s) + +regex='Merge pull request #[0-9]+ from .+/(.+)$' +[[ $commit_subject =~ $regex ]] +branch_name=${BASH_REMATCH[1]} +echo $branch_name \ No newline at end of file diff --git a/action.yaml b/action.yaml index e4d0c41..090d115 100644 --- a/action.yaml +++ b/action.yaml @@ -1,5 +1,5 @@ name: npm-publish -description: "create a listmonk campaign if the name of the branch being merged includes \"post_XXXXXX\"." +description: "create a listmonk campaign if the name of the branch being merged includes \"__post__XXXXXX\"." author: "Bryce Thorup" runs: using: "composite"