Skip to content

Commit

Permalink
chore: Require semantic comments on PR titles. (#9459)
Browse files Browse the repository at this point in the history
### Description

We're looking to use semantic titles for PRs so that they release notes
look a little tidier. This action will enforce this for us.
  • Loading branch information
anthonyshew authored Nov 19, 2024
1 parent 85f9b7f commit fed3248
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Lint pull request title

on:
pull_request_target:
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
main:
name: Validate PR title
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure that a scope must always be provided.
requireScope: false
# Configure additional validation for the subject based on a regex.
# 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}" doesn't match the configured pattern.
Please ensure that the subject doesn't start with a lowercase character.

0 comments on commit fed3248

Please # to comment.