Skip to content
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
72 changes: 72 additions & 0 deletions .github/workflows/semantic-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Semantic Pull Request

on:
pull_request:
types:
- opened
- edited
- synchronize

jobs:
semantic-pr:
name: Validate PR title follows conventional commit format
runs-on: ubuntu-latest
# TODO: Remove this once we commit to conventional commits
continue-on-error: true

steps:
- name: Validate PR title
id: lint_pr_title
uses: amannn/[email protected]
with:
# Allow standard conventional commit types
types: |
fix
feat
docs
style
refactor
perf
test
chore
ci
build
# TODO: Remove this once we've decided on scopes
requireScope: false
# Skip validation for certain labels if needed
ignoreLabels: |
skip-commit-format
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Comment on PR if validation fails
if: steps.lint_pr_title.outputs.error_message != null
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: `⚠️ **Semantic PR Check Failed**

**Error Details:**
\`\`\`
${{ steps.lint_pr_title.outputs.error_message }}
\`\`\`

**Required Format:**
\`\`\`
<type>: <description>
\`\`\`

**Allowed types:** fix, feat, docs, style, refactor, perf, test, chore, ci, build

**Examples:**
- \`feat: add user authentication system\`
- \`fix: resolve memory leak in worker pool\`
- \`docs: update API documentation\`
- \`test: add integration tests for auth flow\`

This is currently a **warning only** and won't block your PR from being merged.`
})