diff --git a/.github/workflows/semantic-pr-titles.yml b/.github/workflows/semantic-pr-titles.yml new file mode 100644 index 000000000000..24b6fb7c7ab9 --- /dev/null +++ b/.github/workflows/semantic-pr-titles.yml @@ -0,0 +1,52 @@ +name: Semantic PR Titles + +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: + # keep this synchronized with the /CONTRIBUTING.md + types: | + docs + feat + fix + test + chore + # deps is used by renovate for its PRs + scopes: | + deps + ast-spec + eslint-plugin + eslint-plugin-internal + eslint-plugin-tslint + experimental-utils + parser + scope-manager + type-utils + types + typescript-estree + utils + visitor-keys + website + # we allow "cross package" PRs with no scope + requireScope: false + # ensure that the subject is lower-case first + # also allows "[rule-name] " prefix for eslint-plugin rule PRs + # https://regexr.com/733ed + subjectPattern: ^(\[[a-z\-]+\] )?[a-z].+[^\.]$ + subjectPatternError: | + The "subject" must start with a lower-case letter and must not + end with a full-stop. + For PRs that add or change ESLint-plugin rules, you should begin + the title with "[rule-name] " diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3c08116cdc9c..aaf07b243ee4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -84,6 +84,8 @@ Within the body of your PR, make sure you reference the issue that you have work Must be one of the following: + + - `docs` - if you only change documentation, and not shipped code - `feat` - for any new functionality additions - `fix` - for any bug fixes that don't add new functionality