Skip to content

Commit 0b42534

Browse files
authored
chore(infra): add PR title linting workflow (#1177)
1 parent 8170804 commit 0b42534

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed

.github/workflows/pr_lint.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# -----------------------------------------------------------------------------
2+
# PR Title Lint Workflow
3+
#
4+
# Purpose:
5+
# Enforces Conventional Commits format for pull request titles to maintain a
6+
# clear, consistent, and machine-readable change history across our repository.
7+
# This helps with automated changelog generation and semantic versioning.
8+
#
9+
# Enforced Commit Message Format (Conventional Commits 1.0.0):
10+
# <type>[optional scope]: <description>
11+
# [optional body]
12+
# [optional footer(s)]
13+
#
14+
# Allowed Types:
15+
# • feat — a new feature (MINOR bump)
16+
# • fix — a bug fix (PATCH bump)
17+
# • docs — documentation only changes
18+
# • style — formatting, missing semi-colons, etc.; no code change
19+
# • refactor — code change that neither fixes a bug nor adds a feature
20+
# • perf — code change that improves performance
21+
# • test — adding missing tests or correcting existing tests
22+
# • build — changes that affect the build system or external dependencies
23+
# • ci — continuous integration/configuration changes
24+
# • chore — other changes that don't modify src or test files
25+
# • revert — reverts a previous commit
26+
# • release — prepare a new release
27+
#
28+
# Allowed Scopes (optional):
29+
# genai, vertex, community, infra
30+
#
31+
# Rules & Tips for New Committers:
32+
# 1. Subject (type) must start with a lowercase letter and, if possible, be
33+
# followed by a scope wrapped in parenthesis `(scope)`
34+
# 2. Breaking changes:
35+
# – Append "!" after type/scope (e.g., feat!: drop Node 12 support)
36+
# – Or include a footer "BREAKING CHANGE: <details>"
37+
# 3. Example PR titles:
38+
# feat(genai): add multi‐tenant support
39+
# fix(vertex): resolve flag parsing error
40+
# feat(vertex)!: drop string support for invoke
41+
# docs: update API usage examples
42+
# docs(community): update API usage examples
43+
#
44+
# Resources:
45+
# • Conventional Commits spec: https://www.conventionalcommits.org/en/v1.0.0/
46+
# -----------------------------------------------------------------------------
47+
48+
name: '🏷️ PR Title Lint'
49+
50+
permissions:
51+
pull-requests: read
52+
53+
on:
54+
pull_request:
55+
types: [opened, edited, synchronize]
56+
57+
jobs:
58+
# Validates that PR title follows Conventional Commits specification
59+
lint-pr-title:
60+
name: 'Validate PR Title Format'
61+
runs-on: ubuntu-latest
62+
steps:
63+
- name: '✅ Validate Conventional Commits Format'
64+
uses: amannn/action-semantic-pull-request@v6
65+
env:
66+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
67+
with:
68+
types: |
69+
feat
70+
fix
71+
docs
72+
style
73+
refactor
74+
perf
75+
test
76+
build
77+
ci
78+
chore
79+
revert
80+
release
81+
scopes: |
82+
genai
83+
vertex
84+
community
85+
infra
86+
requireScope: false
87+
disallowScopes: |
88+
release
89+
[A-Z]+
90+
ignoreLabels: |
91+
ignore-lint-pr-title

0 commit comments

Comments
 (0)