Skip to content

Commit da7ed81

Browse files
authored
deps(release): Use deps and fix title checker. (#943)
1 parent 4985fe9 commit da7ed81

File tree

4 files changed

+50
-11
lines changed

4 files changed

+50
-11
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: 'Validate PR Title'
2+
description: 'Validates that PR titles follow conventional commit format with custom types'
3+
inputs:
4+
title:
5+
description: 'PR title to validate'
6+
required: true
7+
outputs:
8+
valid:
9+
description: 'Whether the title is valid'
10+
value: ${{ steps.validate.outputs.valid }}
11+
runs:
12+
using: 'composite'
13+
steps:
14+
- name: Validate PR title
15+
id: validate
16+
shell: bash
17+
run: |
18+
title="${{ inputs.title }}"
19+
20+
# Define allowed types
21+
allowed_types="feat|fix|docs|style|refactor|perf|test|build|ci|chore|deps"
22+
23+
# Check if title matches conventional commit format
24+
if echo "$title" | grep -qE "^($allowed_types)(\(.+\))?!?: .+"; then
25+
echo "valid=true" >> $GITHUB_OUTPUT
26+
echo "✅ PR title is valid: $title"
27+
else
28+
echo "valid=false" >> $GITHUB_OUTPUT
29+
echo "❌ PR title is invalid: $title"
30+
echo ""
31+
echo "Expected format: <type>[optional scope]: <description>"
32+
echo ""
33+
echo "Allowed types: $allowed_types"
34+
echo ""
35+
echo "Examples:"
36+
echo " feat: add new feature"
37+
echo " fix: resolve bug"
38+
echo " deps: update dependencies"
39+
echo " chore: update CI configuration"
40+
exit 1
41+
fi

.github/dependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ updates:
1010
schedule:
1111
interval: "weekly"
1212
commit-message:
13-
prefix: "build"
13+
prefix: "deps"
1414
include: "scope"
1515
- package-ecosystem: "github-actions"
1616
# Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)

.github/workflows/lint-pr.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
name: Validate PR title
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: amannn/action-semantic-pull-request@v6
16-
env:
17-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
15+
- name: Checkout
16+
uses: actions/checkout@v5
17+
18+
- name: Validate PR title
19+
uses: ./.github/actions/validate-pr-title
20+
with:
21+
title: ${{ github.event.pull_request.title }}

release-please-config.json

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,5 @@
55
"release-type": "node",
66
"package-name": "5e-database"
77
}
8-
},
9-
"changelog-sections": [
10-
{
11-
"type": "build",
12-
"section": "Dependencies"
13-
}
14-
]
8+
}
159
}

0 commit comments

Comments
 (0)