Skip to content

Commit

Permalink
chore: Require semantic release on PR titles.
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonyshew committed Nov 19, 2024
1 parent 85f9b7f commit 8989dd2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/semantic-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Lint pull request title

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

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 8989dd2

Please sign in to comment.