Skip to content

Commit

Permalink
ci: enforce PR titles to follow the conventional commit specification (
Browse files Browse the repository at this point in the history
…#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
  • Loading branch information
thomaseizinger authored Dec 13, 2022
1 parent f828db6 commit 868c380
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ updates:
schedule:
interval: "daily"
open-pull-requests-limit: 9999

commit-message:
prefix: "deps"
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "daily"
commit-message:
prefix: "deps"
21 changes: 21 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,24 @@ jobs:
run: |
WORKSPACE_MEMBERS=$(cargo metadata --format-version=1 --no-deps | jq -c '.packages | .[] | select(.publish == null) | .name' | jq -s '.' | jq -c '.')
echo "members=${WORKSPACE_MEMBERS}" >> $GITHUB_OUTPUT
validate_pr_title:
name: Validate PR title
runs-on: ubuntu-latest
if: ${{ github.event_name == 'pull_request' }}
steps:
- uses: amannn/action-semantic-pull-request@01d5fd8a8ebb9aafe902c40c53f0f4744f7381eb # v5.0.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Configure which types are allowed (newline delimited).
types: |
feat
fix
chore
docs
deps
test
ci
refactor
require_scope: false

0 comments on commit 868c380

Please sign in to comment.