Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/taskmedia/action-conventional-commits

Check if your PR commits matching with https://www.conventionalcommits.org/
https://github.com/taskmedia/action-conventional-commits

action actions commit commits conventional conventional-commits hacktoberfest pr

Last synced: 4 months ago
JSON representation

Check if your PR commits matching with https://www.conventionalcommits.org/

Awesome Lists containing this project

README

        

# GitHub Action: verify conventional commits

# Description

Check if commits of a PR match against the conventional commits specification.

See: https://conventionalcommits.org/

# Usage

```yaml
- uses: taskmedia/[email protected]
with:
# token to access GitHub API to receive PR commits
# Default: ${{ github.token }}
token: ""

# skip merge commits
# Default: true
skip_merge: ""

# skip revert commits
# Default: true
skip_revert: ""

# allow different types in commit message
# Default: fix|feat|revert
types: ""
```

# Inputs

| **Input** | **Description** | **Default** | **Required** |
| ----------------- | ------------------------------------------------ | ------------------------------ | ------------ |
| **`token`** | token to access GitHub API to receive PR commits | `${{ github.token }}` | **false** |
| **`skip_merge`** | skip merge commits | `true` | **false** |
| **`skip_revert`** | skip revert commits | `true` | **false** |
| **`types`** | allow different types in commit message | fix\|feat\|revert | **false** |

# Outputs

| **Output** | **Description** |
| --------------------- | ----------------------------------------------------------------------------------------------- |
| **`breaking_commit`** | indicates if a breaking commit was found |
| **`breaking_msg`** | returns the breaking message of the last breaking commit |
| **`commits`** | JSON list of commits in PR |
| **`count_commits`** | count of commits in PR |
| **`invalid_commits`** | indicates if this commit does not match with conventional commits (other values might be empty) |
| **`version_type`** | semantic versioning indicator (patch, minor or major) |

### JSON format example output `commits`

```json
[
{
"invalid": false,
"full": "fix(app)!: changed something\n\nThis is a big change\r\n\r\nBREAKING CHANGE: API changed",
"type": "fix",
"breaking": true,
"scope": "app",
"message": "changed something",
"body": "This is a big change",
"breaking_change": "API changed"
}
]
```