Skip to content

Commit

Permalink
feat(ci): add lint pipeline for PRs
Browse files Browse the repository at this point in the history
Signed-off-by: ozkanonur <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed May 26, 2023
1 parent 9a0fe0f commit 749ec84
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: "PR Lint"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
chore
docs
deps
test
refactor
ci
requireScope: true
# Do not allow starting with uppercase for subject part
subjectPattern: ^(?![A-Z]).+$
headerPatternCorrespondence: type, scope, subject

- name: Check PR title length
env:
TITLE: ${{ github.event.pull_request.title }}
run: |
title_length=${#TITLE}
if [ $title_length -gt 72 ]
then
echo "PR title is too long (greater than 72 characters)"
exit 1
fi

0 comments on commit 749ec84

Please sign in to comment.