Skip to content

Commit

Permalink
ci_: validate pr title (#5872)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-sirotin authored Sep 26, 2024
1 parent d794e43 commit a1c6d7f
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/commit-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,6 +23,7 @@ jobs:

- name: Check commit message
id: check_commit_message
if: always()
run: |
set +e
Expand Down Expand Up @@ -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"
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit a1c6d7f

Please sign in to comment.