Skip to content

Commit 498f7c7

Browse files
chore(ci): update PR title check to exclude chore and release titles (#30528)
Updates our PR title check to ignore titles with `chore` or `release` in them, eliminating the need for a `release` label on release PRs & allowing us to write commits like `chore: update dependency`. I also specified which commit types are allowed and included `chore` and `release` here even though they are skipped in case we ever remove the if skipping them. Co-authored-by: Brandy Smith <[email protected]>
1 parent b5b4c35 commit 498f7c7

File tree

1 file changed

+21
-10
lines changed

1 file changed

+21
-10
lines changed

.github/workflows/conventional-commit.yml

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,35 @@ jobs:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Validate PR title
12-
uses: amannn/action-semantic-pull-request@v5
12+
if: |
13+
!contains(github.event.pull_request.title, 'release') &&
14+
!contains(github.event.pull_request.title, 'chore')
15+
uses: amannn/action-semantic-pull-request@v5
1316
env:
1417
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1518
with:
1619
# Configure that a scope must always be provided.
1720
requireScope: true
21+
# Configure allowed commit types
22+
types: |
23+
feat
24+
fix
25+
docs
26+
style
27+
refactor
28+
perf
29+
test
30+
build
31+
ci
32+
revert
33+
release
34+
chore
1835
# Configure additional validation for the subject based on a regex.
1936
# This example ensures the subject doesn't start with an uppercase character.
2037
subjectPattern: ^(?![A-Z]).+$
21-
# If `subjectPattern` is configured, you can use this property to
22-
# override the default error message that is shown when the pattern
23-
# doesn't match. The variables `subject` and `title` can be used
38+
# If `subjectPattern` is configured, you can use this property to
39+
# override the default error message that is shown when the pattern
40+
# doesn't match. The variables `subject` and `title` can be used
2441
# within the message.
2542
subjectPatternError: |
2643
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.
27-
# If the PR contains one of these newline-delimited labels, the
28-
# validation is skipped. If you want to rerun the validation when
29-
# labels change, you might want to use the `labeled` and `unlabeled`
30-
# event triggers in your workflow.
31-
ignoreLabels: |
32-
release

0 commit comments

Comments
 (0)