Skip to content

Commit

Permalink
Merge pull request #10 from matmar10/rename
Browse files Browse the repository at this point in the history
docs: add README, logo, & rename package
  • Loading branch information
matmar10 authored Oct 19, 2021
2 parents ff0991c + 2fa32ce commit 30cb69d
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 7 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Test the action locally
uses: ./
uses: matmar10/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
63 changes: 61 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,61 @@
# pr-conventional-commit
Enforce conventional commits against multiple commits within a single PR
![Prcolinter](https://github.com/matmar10/prcolinter/blob/master/logo.png?raw=true "Percolinter PR Conventional Commit Linter")

Easily lint _each_ commit for your PRs against the [Conventional Commit](https://www.conventionalcommits.org/) spec based on [configurable Linter rules](https://github.com/conventional-changelog/commitlint/blob/master/docs/reference-rules.md).

**Brew up a stronger commit history!**

## Quick Start

```yaml
name: Conventional Commit

on:
pull_request:
branches: [ '*' ]

jobs:
lint-commits:
steps:
- uses: actions/checkout@v2
- uses: matmar10/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
```
## Custom rules
By default, it uses [@commitlint/config-conventional](https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/index.js) rules.
Add a JSON file under `.github/prcolinterrc.json` to define your customer rules:

```json
{
"rules": {
"body-max-line-length": [2, "always", 300],
}
}
```

-- or --

You can use or customize any of the [Commitlint rules listed here](https://github.com/conventional-changelog/commitlint/blob/master/docs/reference-rules.md)

You can also define custom rules inline:

```yaml
name: Conventional Commit
on:
pull_request:
branches: [ '*' ]
jobs:
lint-commits:
steps:
- uses: actions/checkout@v2
- uses: matmar10/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
# NOTE: the use of a string, not an object because github doesn't support objects as args
rules: '{"body-max-line-length": [2, "always", 300]}'
```
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ inputs:
required: true
config_path:
description: Path to configuration file
default: './.github/prclintrc.json'
default: './.github/prcolinterrc.json'
rules:
description: 'Rule set for commit linter. For examples, see https://github.com/conventional-changelog/commitlint/blob/master/@commitlint/config-conventional/index.js'

Expand Down
Binary file added logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "pr-conventional-commit",
"name": "prcolinter",
"version": "1.1.0",
"description": "",
"main": "index.js",
Expand All @@ -25,6 +25,7 @@
"@commitlint/lint": "^13.2.0"
},
"release-it": {
"ci": true,
"plugins": {
"@release-it/conventional-changelog": {
"infile": "CHANGELOG.md",
Expand Down Expand Up @@ -85,8 +86,7 @@
"release": true
},
"npm": {
"private": true,
"publish": false
"publish": true
}
}
}

0 comments on commit 30cb69d

Please sign in to comment.