Skip to content

Commit

Permalink
feat: add conventional commits PR linter
Browse files Browse the repository at this point in the history
  • Loading branch information
The0mikkel committed May 10, 2024
1 parent 1af6b1e commit 66d371b
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/pr-test-conventionalcommits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: PR format test - Conventional commits

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

jobs:
linter:
name: Pull Request title check
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

# https://github.com/marketplace/actions/semantic-release-pr-title-check
- name: Semantic Release PR Title Check
uses: osl-incubator/semantic-release-pr-title-check@c67ca9c687967721b9b351970ff8c65fc5658dd8 # v1.4.3
with:
convention-name: conventionalcommits
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ Please only use `main` as the version, if you want to use the latest version, as

## Available actions

A wide range of actions are available, from Semver to linting.

- [Semver release](#semver-release)
- [Docker build and push](#docker-build-and-push)
- [PR format test - Conventional commits](#pr-format-test---conventional-commits)

### Semver release

This action will run Semantic Release to determine the next version of the package and create a new release.
Expand Down Expand Up @@ -144,3 +150,33 @@ Where it is located can be specified in the action.
with:
semver: ${{ needs.release.outputs.version }}
```

### PR format test - Conventional commits

This action checks if the PR title fits the [Conventional commits](https://conventionalcommits.org) format.
Perfect for ensuring the PR fits the Conventional commits format for [Semantic release](https://semantic-release.gitbook.io/semantic-release/).

#### Pre-requisites

This action requires no specific setup in the repository.

#### Inputs

There are not inputs for this action.

#### Example usage

**Usage of the action:**

```yaml
name: PR format test - Conventional commits
on:
pull_request:
types: [opened, synchronize, edited, reopened]
jobs:
pr-linter:
name: Pull Request title check
uses: the0mikkel/ci/.github/workflows/[email protected]
```

0 comments on commit 66d371b

Please sign in to comment.