Skip to content

Commit 868c380

Browse files
ci: enforce PR titles to follow the conventional commit specification (#3204)
As per decision in #3083, we want to use the conventional commits in our repository. To make sure this actually happens, this patch adds a workflow that validates PR titles to follow this convention. Together with our mergify configuration, these PR titles end up being the commit message title when squash-merging a pull request. Related: #3083 Related: libp2p/github-mgmt#93
1 parent f828db6 commit 868c380

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

.github/dependabot.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,11 @@ updates:
55
schedule:
66
interval: "daily"
77
open-pull-requests-limit: 9999
8-
8+
commit-message:
9+
prefix: "deps"
910
- package-ecosystem: "github-actions"
1011
directory: "/"
1112
schedule:
12-
# Check for updates to GitHub Actions every weekday
1313
interval: "daily"
14+
commit-message:
15+
prefix: "deps"

.github/workflows/ci.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,24 @@ jobs:
267267
run: |
268268
WORKSPACE_MEMBERS=$(cargo metadata --format-version=1 --no-deps | jq -c '.packages | .[] | select(.publish == null) | .name' | jq -s '.' | jq -c '.')
269269
echo "members=${WORKSPACE_MEMBERS}" >> $GITHUB_OUTPUT
270+
271+
validate_pr_title:
272+
name: Validate PR title
273+
runs-on: ubuntu-latest
274+
if: ${{ github.event_name == 'pull_request' }}
275+
steps:
276+
- uses: amannn/action-semantic-pull-request@01d5fd8a8ebb9aafe902c40c53f0f4744f7381eb # v5.0.2
277+
env:
278+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
279+
with:
280+
# Configure which types are allowed (newline delimited).
281+
types: |
282+
feat
283+
fix
284+
chore
285+
docs
286+
deps
287+
test
288+
ci
289+
refactor
290+
require_scope: false

0 commit comments

Comments
 (0)