https://github.com/beemojs/conventional-pr-action
GitHub Action that validates the PR title and commits against a Conventional Commits preset.
https://github.com/beemojs/conventional-pr-action
Last synced: 3 days ago
JSON representation
GitHub Action that validates the PR title and commits against a Conventional Commits preset.
- Host: GitHub
- URL: https://github.com/beemojs/conventional-pr-action
- Owner: beemojs
- Created: 2019-10-03T00:20:31.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-09T00:13:04.000Z (about 2 years ago)
- Last Synced: 2026-06-03T18:04:55.857Z (21 days ago)
- Language: TypeScript
- Homepage:
- Size: 18.1 MB
- Stars: 15
- Watchers: 1
- Forks: 3
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# conventional-pr-action
GitHub Action that validates a pull request title against a
[Conventional Commits](https://www.conventionalcommits.org) preset.
## Setup
Create a `.github/workflows/pr.yml` file in your repository with the following contents. The
`GITHUB_TOKEN` environment variable and latest actions _are_ required.
```yaml
name: PR
on: pull_request
jobs:
conventional:
name: Conventional PR
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: beemojs/conventional-pr-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
Supports the following input options:
- `auto-install` - Automatically install dependencies and the preset npm package. Defaults to
`true`.
- `config-preset` - The conventional changelog config preset. Defaults to
[`beemo`](https://github.com/beemojs/conventional-changelog-beemo).
- `config-version` - The conventional changelog config preset package version to install. Defaults
to `latest`.
- `require-multiple-commits` - Validates the commits for use within squash merging. Defaults to
`false`.
## Choosing a preset
Conventional commits require a changelog preset, and this action defaults to
[`conventional-changelog-beemo`](https://github.com/beemojs/conventional-changelog-beemo). If you'd
like to use another preset, update the `config-preset` option.
```yaml
- uses: beemojs/conventional-pr-action@v3
with:
config-preset: eslint
```
Furthermore, the preset _must_ exist in `node_modules` for the action to work correctly. The action
currently supports the following workflows:
### Automatic installation
If the `auto-install` option is true (the default), the action will automatically install the preset
at the root of the repository using your chosen package manager.
> This will modify the working tree of your checkout!
### Manual installation
If you don't want to use automatic installation, you'll need to disable the `auto-install` option,
and add your chosen preset manually to `devDependencies` in the root `package.json`.
```yaml
- uses: beemojs/conventional-pr-action@v3
with:
auto-install: false
```