From bcde29c891bc3500cc3d628a7ed50c8c41ff39c8 Mon Sep 17 00:00:00 2001 From: ozkanonur Date: Fri, 26 May 2023 09:58:23 +0300 Subject: [PATCH] feat(ci): add lint pipeline for PRs Signed-off-by: ozkanonur --- .github/workflows/pr-lint.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 .github/workflows/pr-lint.yml diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml new file mode 100644 index 0000000000..53b55ca6a6 --- /dev/null +++ b/.github/workflows/pr-lint.yml @@ -0,0 +1,42 @@ +name: "PR Lint" + +on: + pull_request: + types: + - opened + - edited + - synchronize + +jobs: + main: + name: Validate PR title + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5.2.0 + 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