diff --git a/.github/workflows/BRANCH_NAME_CHECK_ON_PR.yml b/.github/workflows/BRANCH_NAME_CHECK_ON_PR.yml index b0564141c8..d62c850a3e 100644 --- a/.github/workflows/BRANCH_NAME_CHECK_ON_PR.yml +++ b/.github/workflows/BRANCH_NAME_CHECK_ON_PR.yml @@ -10,14 +10,13 @@ jobs: steps: - name: Extract branch name id: extract_branch - run: echo "::set-output name=branch::${GITHUB_HEAD_REF}" + run: echo "${{ github.event.pull_request.title }}" - name: Check if branch name follows conventional commit regex run: | BRANCH_REGEX='^(feat|fix|docs|style|refactor|perf|test|chore)\(?.+\)?: .+$' - echo ${{steps.extract_branch.outputs.branch}} - if [[ "${{ steps.extract_branch.outputs.branch }}" =~ $BRANCH_REGEX ]]; then - echo "Branch name follows the conventional commit format." + if [[ "${{ github.event.pull_request.title }}" =~ $BRANCH_REGEX ]]; then + echo "Pull request name follows the conventional commit format." else - echo "Branch name does not follow the conventional commit format." + echo "Pull request does not follow the conventional commit format." exit 1 fi \ No newline at end of file