diff --git a/.github/workflows/validate-pr-title.yml b/.github/workflows/validate-pr-title.yml new file mode 100644 index 0000000..aa3588f --- /dev/null +++ b/.github/workflows/validate-pr-title.yml @@ -0,0 +1,17 @@ +# name of the action +name: validate PR title + +# trigger on pull_request events of the opened & edited type. +on: + pull_request: + types: [ opened, synchronize, edited, reopened ] + +# pipeline to execute +jobs: + validate: + runs-on: ubuntu-latest + + steps: + - name: validate title + run: | + echo "${{ github.event.pull_request.title }}" | grep -Eq '^(feat|fix|chore|refactor|enhance|test|docs)\(.*\):.*$' && (echo "Pass"; exit 0) || (echo "Incorrect Format. Please see https://go-vela.github.io/docs/community/contributing_guidelines/#development-workflow"; exit 1) \ No newline at end of file