Skip to content

Commit

Permalink
ci: validate that PR titles are conventional (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattlewis92 committed Nov 3, 2023
1 parent 72f24b2 commit 672d651
Show file tree
Hide file tree
Showing 4 changed files with 552 additions and 1 deletion.
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

0 comments on commit 672d651

Please sign in to comment.