diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 9e739ff330..a9c280a2de 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -127,12 +127,6 @@ jobs: sudo apt-get install -y clang-format-18 npm ci --ignore-scripts clang-format-18 --version - - name: Check PR title format - if: github.event_name == 'pull_request' - env: - PR_TITLE: ${{ github.event.pull_request.title }} - run: | - node ./scripts/check_pr_title.js - name: Run checks run: | ./scripts/check_taginfo.py taginfo.json profiles/car.lua diff --git a/.github/workflows/pr-title-check.yml b/.github/workflows/pr-title-check.yml new file mode 100644 index 0000000000..767bfec6a6 --- /dev/null +++ b/.github/workflows/pr-title-check.yml @@ -0,0 +1,27 @@ +name: PR Title Check + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + branches: + - master + +permissions: + contents: read + +jobs: + conventional-pr-title: + runs-on: ubuntu-slim + + steps: + - name: Validate pull request title + env: + PR_TITLE: ${{ github.event.pull_request.title }} + run: | + pattern='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\([[:alnum:]_.-]+\))?(!)?: .+$' + + if [[ ! "$PR_TITLE" =~ $pattern ]]; then + echo "PR title must follow Conventional Commits, for example: feat(ui): add route summary" + echo "Got: $PR_TITLE" + exit 1 + fi