ci_: validate pr title (#5872)
This commit is contained in:
parent
d794e43347
commit
a1c6d7f333
|
@ -9,8 +9,8 @@ on:
|
|||
- labeled
|
||||
- unlabeled
|
||||
jobs:
|
||||
main:
|
||||
name: Validate format
|
||||
lint_pr_commits:
|
||||
name: Validate commit messages
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: write
|
||||
|
@ -23,6 +23,7 @@ jobs:
|
|||
|
||||
- name: Check commit message
|
||||
id: check_commit_message
|
||||
if: always()
|
||||
run: |
|
||||
set +e
|
||||
|
||||
|
@ -50,7 +51,6 @@ jobs:
|
|||
echo "error_message<<$EOF" >> "$GITHUB_ENV"
|
||||
echo "${invalid_commit_messages}" >> "$GITHUB_ENV"
|
||||
echo "$EOF" >> "$GITHUB_ENV"
|
||||
|
||||
fi
|
||||
|
||||
- name: "Publish failed commit messages"
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
name: "Conventional Commits"
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
- reopened
|
||||
- synchronize
|
||||
jobs:
|
||||
lint_pr_title:
|
||||
name: Validate PR title
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@v5
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
# Keep regex in sync with ./_assets/scripts/parse_commits.sh#L25
|
||||
headerPattern: '^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?(\_|!): (.*)$'
|
||||
headerPatternCorrespondence: type, scope, breaking, subject
|
Loading…
Reference in New Issue