diff --git a/.github/workflows/apply-hotfix.yaml b/.github/workflows/apply-hotfix.yaml index 737eaa1ad46..b01b8123992 100644 --- a/.github/workflows/apply-hotfix.yaml +++ b/.github/workflows/apply-hotfix.yaml @@ -1,5 +1,6 @@ name: Apply hotfix to branch on: + pull_request: workflow_dispatch: inputs: pr_number: @@ -26,7 +27,7 @@ jobs: if [ "${{ github.event.inputs.branch_name }}" != "" ]; then branch_name="${{ github.event.inputs.branch_name }}" else - branch_name=$(git branch -r --list 'release/*' | sort -r | head -n 1 | xargs) + branch_name=$(git branch -r --list 'origin/release/*' | grep -E 'release/[0-9]{4}-[0-9]{2}-[0-9]{2}' | sort -r | head -n 1 | xargs) fi if [ -z "$branch_name" ]; then