ci(workflows): add semantic PR title lint workflow#79
Merged
snowrugar-beep merged 2 commits intoJun 22, 2026
Merged
Conversation
Adds .github/workflows/pr-title-lint.yml using amannn/action-semantic-pull-request@v5.5.0 to enforce Conventional Commits-style PR titles on every PR open, edit, reopen, and synchronize against main. The workflow: - explicitly pins the allowed commit types (matches CONTRIBUTING.md) - uses pull_request (not pull_request_target) for fork-PR safety - grants only the minimum permissions the action needs - cancels superseded runs on PR title iteration Also tightens CONTRIBUTING.md PR guidelines to reference the new lint workflow so contributors see the automated enforcement. Closes VertexChainLabs#36
…in pr-title-lint Two latent bugs surfaced when the workflow ran against PR VertexChainLabs#79: 1. `types` was encoded as a multi-line JSON array in YAML. The amannn action ships a ConfigParser that splits the types input by `\n` and trims/filters empties — it does NOT parse a JSON array. The earlier YAML therefore silently produced a 13-element garbage list (`"[`, ` "feat",`, `"ci",`, `]`, …) so `types.includes(result.type)` rejected every title under the message "Unknown release type". Switching to newline-delimited plaintext (one type per line). 2. `subjectPattern` was previously `^(\w+)(?:\([\w\-\.\/]+\))?!?: .+$`, intended for the FULL title. The action matches it against the parsed bare `subject` (after conventional-commits-parser strips the `<type>(<scope>)!:` prefix), so the regex would never have matched a real subject. Replaced with `^.{1,72}$` enforcing CONTRIBUTING.md's `<= 72 chars` rule, with an updated error message that points contributors at CONTRIBUTING.md. Also updated inline comments so a future maintainer cannot reintroduce the same two bugs. Closes VertexChainLabs#36
2 tasks
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
.github/workflows/pr-title-lint.yml, a GitHub Actions workflow that enforces Conventional Commits-style PR titles on every pull request againstmain. This unlocks automated changelog categorization and complements (does not replace) the existing CI matrix in.github/workflows/ci.yml.Closes #36.
What this workflow does
pull_requestevents[opened, edited, reopened, synchronize]against themainbranch.amannn/action-semantic-pull-request@v5.5.0(pinned to a specific patch, matching the@vX.Y.Zconvention used inci.yml).feat,fix,chore,docs,style,refactor,perf,test,build,ci,revert— mirrors the spec inCONTRIBUTING.md.^(\w+)(?:\([\w\-\.\/]+\))?!?: .+$— accepts<type>[(scope)][!]: <summary>with optional scope (intentional, matches the existing mix of scoped/unscoped commit log) and optional!for breaking changes per the Conventional Commits spec.CONTRIBUTING.mdwith worked examples.pull_request, notpull_request_target, so secrets stay safe on fork PRs.contents: read,pull-requests: read,statuses: write.cancel-in-progress: trueso superseded runs cancel when authors iterate on the title.Docs change
CONTRIBUTING.md— under "Pull Request Guidelines", the Title bullet now references the new workflow so contributors see the automated enforcement alongside the existing example list.Validation performed
typesJSON loads back into the expected 11-entry array (validated withpython3 + PyYAML).CONTRIBUTING.mdedit; all actionable feedback was applied (literal-block JSON encoding, scope-is-optional rationale, etc.).Checklist
.github/workflows/ci.yml(permissions, concurrency, comments).actions/checkoutstep.