Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ci): enforce conventional commits #334

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 12 additions & 18 deletions .github/workflows/pr-compliance.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
name: Pull-Request Compliance

on:
pull_request:
types: [opened, edited, closed, reopened, synchronize]
types:
- opened
- edited
- synchronize
- reopened

permissions:
pull-requests: read

jobs:
check-pr-title:
name: Check PR title
runs-on: ubuntu-24.04
# See https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
env:
TITLE: ${{ github.event.pull_request.title }}
steps:
- name: Check title format
run: |
# has a colon which separates the area from the description
# max 72 characters
exit_code=0
if [[ ! ${TITLE} =~ ^[^:]+:.+$ ]]; then
echo "PR title must specify an area and a description, see README.md"
exit_code=1
fi
if [[ ${#TITLE} -gt 72 ]]; then
echo "PR title is too long, see README.md"
exit_code=1
fi
exit $exit_code
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # pin@v5.5.3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading