https://github.com/adityaa30/check-commit
Github Action to check if the commit follows proper syntax ๐
https://github.com/adityaa30/check-commit
commit-conventions github-actions hacktoberfest typescript
Last synced: 3 days ago
JSON representation
Github Action to check if the commit follows proper syntax ๐
- Host: GitHub
- URL: https://github.com/adityaa30/check-commit
- Owner: adityaa30
- License: mit
- Created: 2020-04-04T01:55:48.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2021-05-16T12:59:41.000Z (almost 5 years ago)
- Last Synced: 2026-02-21T16:40:44.809Z (22 days ago)
- Topics: commit-conventions, github-actions, hacktoberfest, typescript
- Language: TypeScript
- Homepage:
- Size: 326 KB
- Stars: 7
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Check Commit Message
Action to check if the commit follows proper guidelines as specified [here](http://karma-runner.github.io/latest/dev/git-commit-msg.html)
## Usage
Create a workflow `.yml` file in your repositories `.github/workflows` directory
(eg. `.github/workflows/check-commit.yml`). In your workflow you first need to checkout
your repository then use this [action](https://github.com/adityaa30/check-commit).
Refer to the example below,
```yaml
name: Check Commit Message
on: [pull_request, push]
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout ๐๏ธ
uses: actions/checkout@v2
- name: Check commit ๐งช
uses: adityaa30/check-commit@master
```
## Input Parameters
- `compulsory-scope`
- Either 'true' or 'false'
- Defaults to 'false'
- If true, scope field becomes compulsory for each commit (refer [here](http://karma-runner.github.io/latest/dev/git-commit-msg.html))
- `max-header-length`
- Should be a valid non-zero positive integer
- Defaults to 50
- Raises an error if length of commit header is more than specified
## Project Installation
**[Fork](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)** the repository
```bash
# Clone the forked repository
git clone https://github.com//check-commit.git
# Enter project directory
cd check-commit
# Install dependencies
npm install
# Build the project
npm run build
```
### NOTE
- Before pushing any changes, please build the project to update the `dist/index.js` in order to reflect your changes in github
- To test the project in your local use [act](https://github.com/nektos/act)
## TODO
- [x] Get the commit message
- [x] Implement rules based on syntax defined [here](http://karma-runner.github.io/latest/dev/git-commit-msg.html)
- [x] Helper functions to check commit message based on rules
- [x] Add input parameter `compulsory-scope`
- [x] Add input parameter `max-header-length`
- [ ] Add a **[CLI](https://en.wikipedia.org/wiki/Command-line_interface)**
- [ ] Add custom **[input parameters](https://help.github.com/en/actions/building-actions/metadata-syntax-for-github-actions#inputs)**