Skip to content

A GitHub Actions to lint PR titles using the CommitLint specifications

License

Notifications You must be signed in to change notification settings

Weburz/pr-lint-action

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

Repository files navigation

PR Title Linter

GitHub commit activity (branch) GitHub Workflow Status (with event) GitHub GitHub repo size GitHub release (with filter)

NOTE: This a WIP project and IS NOT ready for production usage yet!

PR Title Linter is a GitHub Action which uses the CommitLint specifications behind-the-scenes to lint PR titles. The events which triggers the Action are:

  1. When a fresh new PR is created/opened.
  2. When a PR is synchronised or updated with the latest updates from the main/master branch.
  3. When the title of an existing PR is edited/changed.

You can find an entire list of certain events which triggers the Action on GitHub's documentations here - Events that trigger workflows - pull_request_target. So, if you feel we are missing on a certain event please let us know or even better sharing a PR 😉

Usage and Development Guidelines

To use this Action to lint the PR titles of your repositories on GitHub, follow the instructions detailed in this section.

All you will need is an YAML file, name it anything but at Weburz we like the filename to be as pr-lint.yml. Store the pr-lint.yml file at the .github/workflows directory. If you want to learn more about using existing GitHub Actions for certain workflows, refer to the documentations at - About Workflows.

That said, with the pr-lint.yml file created, copy the following contents to it:

name: Lint PR Titles

on:
  pull_request_target:
    types:
      - opened
      - edited
      - synchronize

jobs:
  pr-lint:
    name: Lint PR Titles
    runs-on: ubuntu-latest
    steps:
      - uses: Weburz/[email protected]

Push the latest commits to a remote repository and then create an example PR which should trigger the Action thereafter. If you stumbled across a bug or an unintended behaviour, please report it to us at the earliest.

Licensing and Distribution

The contents of this repository are licensed under an open-source license - MIT License. Therefore you are free to copy, modify and distribute the source as you see fit for both commercial and non-commercial usage as long as the usage does not breach the terms and conditions (T&Cs) of the license. To learn more about the T&Cs, please refer to the LICENSE document for a more detailed explanation!

About

A GitHub Actions to lint PR titles using the CommitLint specifications

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks