Skip to content

Commit

Permalink
chore: Add conventional commit check to PR titles (Azure#135)
Browse files Browse the repository at this point in the history
* Added conventional commit check to PRs
  • Loading branch information
c-ryan-k committed Feb 15, 2024
1 parent 5739543 commit 4ac1647
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/conventional_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "[auto] Check PR title format"
on:
pull_request:
types: [
opened,
edited,
ready_for_review,
reopened,
]
jobs:
verify_title:
runs-on: ubuntu-latest
steps:
- name: "Verify PR title matches conventional commits specification"
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
conventional_regex='^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test)(\(.*\))?: .*$'
if [[ "$TITLE" =~ $conventional_regex ]]; then
echo "Success!"
else
echo "Incorrect PR title format" >> $GITHUB_STEP_SUMMARY
exit 1
fi

0 comments on commit 4ac1647

Please sign in to comment.