name: Semantic PR Check

on:
    pull_request:
        types: [opened, synchronize, edited]

jobs:
    pr-title-check:
        name: Check PR for semantic title
        runs-on: ubuntu-latest
        steps:
            - name: Set PR title validity
              id: is-semantic
              if: >
                  startsWith(github.event.pull_request.title, 'feat:')||
                  startsWith(github.event.pull_request.title, 'fix:') ||
                  startsWith(github.event.pull_request.title, 'perf:') ||
                  startsWith(github.event.pull_request.title, 'docs:') ||
                  startsWith(github.event.pull_request.title, 'test:') ||
                  startsWith(github.event.pull_request.title, 'refactor:') ||
                  startsWith(github.event.pull_request.title, 'style:') ||
                  startsWith(github.event.pull_request.title, 'build:') ||
                  startsWith(github.event.pull_request.title, 'ci:') ||
                  startsWith(github.event.pull_request.title, 'chore:') ||
                  startsWith(github.event.pull_request.title, 'revert:')
              run: |
                  OUTPUT=true
                  echo "::set-output name=isSemantic::$OUTPUT"

            - name: echo isSemantic
              run: |
                  echo ${{ steps.is-semantic.outputs.isSemantic }}

            - name: PR title is valid
              if: ${{steps.is-semantic.outputs.isSemantic == 'true'}}
              run: |
                  echo 'Pull request title is valid.'
                  echo ${{ steps.is-semantic.outputs.isSemantic }}

            - name: PR title is invalid
              if: ${{ steps.is-semantic.outputs.isSemantic != 'true'}}
              run: |
                  echo ${{ steps.is-semantic.outputs.isSemantic }}
                  echo 'Pull request title is not valid.'
                  exit 1
Add workflow - semantic pr title check
ci: Add workflow - semantic pr title check

