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

ci: validate that PR titles are conventional #18

Merged
merged 1 commit into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": [
"@commitlint/config-conventional",
"@commitlint/config-nx-scopes"
],
"rules": {
"footer-max-line-length": [0],
"body-max-line-length": [0]
}
}
31 changes: 31 additions & 0 deletions .github/workflows/validate-pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Validate PR title

on:
pull_request:
types: ['opened', 'edited', 'reopened', 'synchronize']

permissions:
pull-requests: read
contents: read

jobs:
validate-pr-title:
runs-on: ubuntu-latest
name: 'Validate PR title'
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install pnpm
uses: pnpm/action-setup@d882d12c64e032187b2edb46d3a0d003b7a43598 # v2.4.0
- name: Setup NodeJs
id: setup-node
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Lint PR title
# TODO - forked until https://github.com/JulienKode/pull-request-name-linter-action/pull/227 is merged
uses: mattlewis92/pull-request-name-linter-action@9c7a21391dfe3e08dbc7247a1a748422a21d640c # v0.5.0
with:
configuration-path: './.commitlintrc.json'
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
"@babel/plugin-syntax-decorators": "^7.22.10",
"@babel/plugin-syntax-typescript": "^7.22.5",
"@babel/types": "^7.23.0",
"@commitlint/cli": "^18.2.0",
"@commitlint/config-conventional": "^18.1.0",
"@commitlint/config-nx-scopes": "^18.3.0",
"@craftamap/esbuild-plugin-html": "^0.6.1",
"@nx/angular": "^17.0.2",
"@nx/eslint": "17.0.2",
Expand Down
Loading
Loading