Skip to content

About

Lints Pull Request titles with git-sumi

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

git-sumi logo: a lantern held on a bamboo stick over the sea

GitHub version Documentation Clean commits

🏮 Run git-sumi Action

This GitHub action runs git-sumi to validate Pull Request titles or lint commit ranges using the sumi.toml configuration set up in the root of your repository.

Inputs

Input Description Default
mode Lint mode: pr-title or commits pr-title
from Start of revision range (exclusive). Only for commits mode. origin/<PR base branch>
to End of revision range (inclusive). Only for commits mode. HEAD

Usage

Add a sumi.toml file to the root of your repository, enabling the rules you want to use (see the configuration and rules documentation).

Linting PR titles

Create the workflow file .github/workflows/git-sumi.yaml:

name: Lint pull request title

on:
  pull_request:
    types:
      - opened
      - edited
      - synchronize
      - ready_for_review

permissions:
  pull-requests: read

jobs:
  main:
    name: Run git-sumi
    runs-on: ubuntu-latest
    steps:
      - uses: welpo/git-sumi-action@main
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Linting commits

To lint all commits in a pull request, set mode: commits:

name: Lint commits

on:
  pull_request:
    types:
      - opened
      - edited
      - synchronize
      - ready_for_review

permissions:
  pull-requests: read

jobs:
  main:
    name: Run git-sumi
    runs-on: ubuntu-latest
    steps:
      - uses: welpo/git-sumi-action@main
        with:
          mode: commits
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

By default, this lints all commits between origin/<PR base branch> and HEAD. You can override the range:

      - uses: welpo/git-sumi-action@main
        with:
          mode: commits
          from: origin/develop
          to: HEAD
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Questions?

Don't hesitate to reach out via the issue tracker, discussions, or email.

License

This project is licensed under the terms of both the MIT license and the Apache License (Version 2.0), at your option.

About

Lints Pull Request titles with git-sumi

Topics

Resources

Code of conduct

Contributing

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors