mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-26 00:46:44 -05:00
56 lines
1.9 KiB
YAML
56 lines
1.9 KiB
YAML
name: Semantic Pull Request
|
|
|
|
on:
|
|
pull_request_target:
|
|
types:
|
|
- opened
|
|
- reopened
|
|
- edited
|
|
- synchronize
|
|
|
|
permissions: {}
|
|
|
|
jobs:
|
|
validate:
|
|
name: Validate PR title
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
pull-requests: write
|
|
steps:
|
|
- name: Check PR title
|
|
uses: amannn/action-semantic-pull-request@48f256284bd46cdaab1048c3721360e808335d50 # v6
|
|
id: lint_pr_title
|
|
with:
|
|
subjectPattern: ^(?![A-Z]).+$ # Ensure the subject doesn't start with an uppercase character
|
|
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.
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: Comment on invalid PR title
|
|
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3
|
|
# NOTE: null comparison is intentional per official README
|
|
if: always() && (steps.lint_pr_title.outputs.error_message != null)
|
|
with:
|
|
header: pr-title-lint-error
|
|
message: |
|
|
Thanks for your contribution!
|
|
|
|
PR titles need to follow [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) format. It looks like your title needs a small adjustment.
|
|
|
|
*Hint:*
|
|
|
|
```
|
|
${{ steps.lint_pr_title.outputs.error_message }}
|
|
```
|
|
|
|
- name: Remove comment on valid PR title
|
|
uses: marocchino/sticky-pull-request-comment@70d2764d1a7d5d9560b100cbea0077fc8f633987 # v3
|
|
# NOTE: null comparison is intentional per official README
|
|
if: ${{ steps.lint_pr_title.outputs.error_message == null }}
|
|
with:
|
|
header: pr-title-lint-error
|
|
delete: true
|