Skip to content

Commit

Permalink
refactor(ci): add more valid PR title types (#2559)
Browse files Browse the repository at this point in the history
  • Loading branch information
Conaclos committed Apr 22, 2024
1 parent a094dac commit 29a4557
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 14 deletions.
28 changes: 17 additions & 11 deletions .github/workflows/pull_request_title_lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,29 +23,35 @@ jobs:
# Configure which types are allowed (newline-delimited).
# ref: CONTRIBUTING.md
types: |
build
chore
ci
docs
feat
fix
docs
test
chore
perf
refactor
release
test
# Configure that a scope must always be provided.
requireScope: false
# Configure which scopes are disallowed in PR titles (newline-delimited).
# For instance by setting the value below, `chore(release): ...` (lowercase)
# and `ci(e2e,release): ...` (unknown scope) will be rejected.
# Configure which scopes are disallowed in PR titles.
# These are regex patterns auto-wrapped in `^ $`.
#
# We disable the following scopes:
# - `release` because we have the `release` type
# - UPPERCASE titles because we promote the use of lowercase
disallowScopes: |
release
[A-Z]+
[A-Z_-]+
# Configure additional validation for the subject based on a regex.
# This example ensures the subject doesn't start with an uppercase character.
subjectPattern: ^(?![A-Z]).+$
# Ensures that the subject doesn't start with an uppercase character.
subjectPattern: ^[^A-Z]
# If `subjectPattern` is configured, you can use this property to override
# the default error message that is shown when the pattern doesn't match.
# The variables `subject` and `title` can be used within the message.
subjectPatternError: |
The subject "{subject}" found in the pull request title "{title}"
didn't match the configured pattern. Please ensure that the subject
doesn't start with an uppercase character.
didn't match the configured pattern.
Please ensure that the subject doesn't start with an uppercase character.
The scope should not be in UPPERCASE.
9 changes: 6 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,16 @@ The following this convention encourages commit best-practices and facilitates c

The following commit prefixes are supported:

- `build:`, a change that affects the build system or external dependencies
- `chore:`, project housekeeping
- `ci:`, a change that affects CI
- `docs:`, a documentation update
- `feat:`, a new feature
- `fix:`, a bugfix
- `docs:`, a documentation update
- `test:`, a test update
- `chore:`, project housekeeping
- `perf:`, project performance
- `refactor:`, refactor of the code without change in functionality
- `release:`, release of a new version
- `test:`, a test update

Below are examples of well-formatted commits:

Expand Down

0 comments on commit 29a4557

Please sign in to comment.