diff --git a/.github/workflows/shared-create-dev-release-pr.yml b/.github/workflows/shared-create-dev-release-pr.yml index 7211ab86b8..2f40a03b3f 100644 --- a/.github/workflows/shared-create-dev-release-pr.yml +++ b/.github/workflows/shared-create-dev-release-pr.yml @@ -80,7 +80,8 @@ jobs: temp_array=() for value in ${ALL_TAGS[@]} do - if ! [[ $value == $TAG_PREFIX$TAG_BASE$TAG_POSTFIX* || $value =~ ${{ inputs.main-tag-regex }} ]]; then + # Exclude any tags not matching the type of release or hotfix tags not on dev or main + if ! [[ ( $value == $TAG_PREFIX$TAG_BASE$TAG_POSTFIX* || $value =~ ${{ inputs.main-tag-regex }} ) && $(git branch -a --contains $value | grep -E 'remotes/origin/dev|remotes/origin/main') ]]; then temp_array+=($value) fi done diff --git a/.github/workflows/shared-create-main-release-pr.yml b/.github/workflows/shared-create-main-release-pr.yml index 7cbd8d9410..e5f669cf1d 100644 --- a/.github/workflows/shared-create-main-release-pr.yml +++ b/.github/workflows/shared-create-main-release-pr.yml @@ -74,7 +74,8 @@ jobs: temp_array=() for value in ${ALL_TAGS[@]} do - if ! [[ $value =~ ${{ inputs.main-tag-regex }} ]]; then + # Exclude any tags not matching the type of release or hotfix tags not on dev or main + if ! [[ ( $value =~ ${{ inputs.main-tag-regex }} ) && $(git branch -a --contains $value | grep -E 'remotes/origin/dev|remotes/origin/main') ]]; then temp_array+=($value) fi done