chore(ci): improve checking the PR title (#464)

- Use [`action-semantic-pull-request`](https://github.com/amannn/action-semantic-pull-request)
- Allow only reading the PR contents
- Enable merge group
This commit is contained in:
Orhun Parmaksız 2023-09-02 23:11:21 +02:00 committed by GitHub
parent e098731d6c
commit 82b40be4ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,21 +1,23 @@
name: Check PR Title
name: Check Pull Requests
on:
pull_request:
pull_request_target:
types:
- opened
- synchronize
- reopened
- edited
- synchronize
merge_group:
permissions:
pull-requests: read
jobs:
check-title:
runs-on: ubuntu-latest
steps:
- name: Check PR title
run: |
title="${{ github.event.pull_request.title }}"
if ! echo "$title" | grep -qE '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(\w+\))?!?: '; then
echo "error: PR title does not follow the Conventional Commits guidelines"
exit 1
fi
- name: Check PR title
if: github.event_name == 'pull_request_target'
uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}