All Projects → thehanimo → pr-title-checker

thehanimo / pr-title-checker

Licence: MIT License
An action to automatically check if pull request titles conform to Contribution Guidelines

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to pr-title-checker

merge-request-notifier
This app shows your merge requests grouped by projects and WIP status. It is accessible from the system tray.
Stars: ✭ 47 (+23.68%)
Mutual labels:  pull-requests
action-semantic-pull-request
A GitHub Action that ensures that your PR title matches the Conventional Commits spec.
Stars: ✭ 377 (+892.11%)
Mutual labels:  pull-requests
pr-reviews-reminder-action
A GitHub Action to send Slack/Teams notification for Pull Request that are waiting for reviewers.
Stars: ✭ 18 (-52.63%)
Mutual labels:  pull-requests
Pyfancy-2
Simple terminal formatting in Python!
Stars: ✭ 32 (-15.79%)
Mutual labels:  styling
pull-request-size
Applies labels to Pull Requests based on the total lines of code changed.
Stars: ✭ 98 (+157.89%)
Mutual labels:  pull-requests
Repo-Excluded-From-HacktoberFest-2021
Know a bit of python & need pr for hacktoberfest ? come join us in the journey
Stars: ✭ 17 (-55.26%)
Mutual labels:  pull-requests
github-pr-reviewers
This project adds more features to github using user scripts.
Stars: ✭ 15 (-60.53%)
Mutual labels:  pull-requests
silver-platter
Automate the creation of merge proposals for scriptable changes
Stars: ✭ 19 (-50%)
Mutual labels:  pull-requests
github-rebase-bot
A github bot that monitors repository PRs, rebases them and merges them as they pass tests
Stars: ✭ 29 (-23.68%)
Mutual labels:  pull-requests
first-pr-repo
A step by step guide to help people make their first Pull Request
Stars: ✭ 29 (-23.68%)
Mutual labels:  pull-requests
Hacktoberfest-2021
Make this Hacktoberfest a learning period and contribute to Great Open Source Projects.
Stars: ✭ 523 (+1276.32%)
Mutual labels:  pull-requests
critiq.vim
Github code reviews from Neovim
Stars: ✭ 69 (+81.58%)
Mutual labels:  pull-requests
QlikSense-Sheet-Styler-Lite
Qlik Sense Styler for 3.2+
Stars: ✭ 17 (-55.26%)
Mutual labels:  styling
tsstyled
A small, fast, and simple CSS-in-JS solution for React.
Stars: ✭ 52 (+36.84%)
Mutual labels:  styling
HacktoberFest2021
Dedicated to hactoberFest2021
Stars: ✭ 30 (-21.05%)
Mutual labels:  pull-requests
HacktoberFest2020
🤗Feel free to submit a PR💻 to have it merged and get a free Hacktoberfest tee👕 from Github🔮. Updated as per new guidelines✔️
Stars: ✭ 22 (-42.11%)
Mutual labels:  pull-requests
hacktoberfest
Fork and Create a Pull Request
Stars: ✭ 13 (-65.79%)
Mutual labels:  pull-requests
hacktoberfest20
Participate in Hacktoberfest by contributing to any Open Source project on GitHub! Here is a starter project for first-time contributors. #hacktoberfest20. Don’t forget to read the README.md for guidance.
Stars: ✭ 18 (-52.63%)
Mutual labels:  pull-requests
auto-request-review
A GitHub Action that automatically requests review of a pull request based on files changes and/or groups the author belongs to 🤖
Stars: ✭ 52 (+36.84%)
Mutual labels:  pull-requests
lobicornis
🤖 [Myrmica Lobicornis 🐜] Bot: Update and Merge Pull Request
Stars: ✭ 27 (-28.95%)
Mutual labels:  pull-requests

Pull Request Title Checker

This action checks if PR titles conform to the Contribution Guidelines ☑️

Consistent title names help maintainers organise their projects better 📚

Shows if the author has reaaaaally read the Contribution Guidelines :P

Usage

Create a config file .github/pr-title-checker-config.json like this one below:

{
  "LABEL": {
    "name": "title needs formatting",
    "color": "EEEEEE"
  },
  "CHECKS": {
    "prefixes": ["fix: ", "feat: "],
    "regexp": "docs\\(v[0-9]\\): ",
    "regexpFlags": "i",
    "ignoreLabels" : ["dont-check-PRs-with-this-label", "meta"]
  },
  "MESSAGES": {
    "success": "All OK",
    "failure": "Failing CI test",
    "notice": ""
  }
}

You can pass in one of prefixes or regexp or even both based on your use case. regexpFlags and ignoreLables are optional fields.

If none of the checks pass, a label will be added to that pull request.
If at least one of them passes, the label will be removed.

This action causes CI tests to fail by default. However, if you don't want CI tests failing just because of this action, simply set alwaysPassCI as true in the CHECKS field.

Also, adding label names to the optional ignoreLabels field will forfeit any checks for PRs with those labels.

Create Workflow

Create a workflow (eg: .github/workflows/pr-title-checker.yml see Creating a Workflow file) to utilize the pr-title-checker action with content:

name: "PR Title Checker"
on:
  pull_request_target:
    types:
      - opened
      - edited
      - synchronize
      - labeled
      - unlabeled

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: thehanimo/[email protected]
        with:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          pass_on_octokit_error: false
          configuration_path: ".github/pr-title-checker-config.json"

NOTE:

  • pull_request_target event trigger should be used (not pull_request) in order to support checking PRs from forks. This was added in v1.3.2. See #8.

  • pass_on_octokit_error is an optional input which defaults to false. Setting it to true will prevent the CI from failing when an octokit error occurs. This is useful when the environment this action is run in is not consistent. For e.g, it could be a missing GITHUB_TOKEN. Thanks to @bennycode for pointing this out.

  • configuration_path is also an optional input which defaults to ".github/pr-title-checker-config.json". If you wish to store your config file elsewhere, pass in the path here.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].