Giter VIP home page Giter VIP logo

slashgear / action-check-pr-title Goto Github PK

View Code? Open in Web Editor NEW
24.0 3.0 17.0 17.51 MB

Github action to check Pull Request title based on JS Regexp This action in really simple and use Github Action core library base on event of your pull requests No need to install anything on your runner to use it. Simple, fast, reliable πŸŽ‰

License: MIT License

JavaScript 68.77% TypeScript 31.23%
action hacktoberfest lint

action-check-pr-title's Introduction

Welcome to action-check-pr-title πŸ‘‹

License: MIT Twitter: Slashgear_ Continous Integration

Github action to check Pull Request title based on JS Regexp

This action in really simple and use Github Action core library base on event of your pull requests No need to install anything on your runner to use it. Simple, fast, reliable πŸŽ‰

Usage

This action allows you to include a title check of a pull request automatically. This action only works on pull_request events.

To use it, add the following steps in your workflow:

Default usage

steps:
  - uses: Slashgear/[email protected]
    with:
      regexp: "([a-z])+" # Regex the title should match.

Customize Regexp

steps:
  - uses: Slashgear/[email protected]
    with:
      regexp: "([a-z])+" # Regex the title should match.
      flags: "i" # Flags to add to the regexp

Add helper message

steps:
  - uses: Slashgear/[email protected]
    with:
      regexp: "(feat|fix|docs): .++" # Regex the title should match.
      helpMessage: "Example: 'feat: example of title'"

Author

πŸ‘€ Slashgear

🀝 Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page.

Show your support

Give a ⭐️ if this project helped you!

πŸ“ License

Copyright Β© 2020 Slashgear.
This project is MIT licensed.


This README was generated with ❀️ by readme-md-generator

action-check-pr-title's People

Contributors

dependabot[bot] avatar drobnyd avatar jagoncalves14 avatar slashgear avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

action-check-pr-title's Issues

Node.js 12 actions are deprecated

Thanks for the great project!

When using the action in the current version 3.0.0, I get the following warning message:

Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: Slashgear/action-check-pr-title

Bildschirmfoto 2022-10-19 um 15 14 43

I just wanted to make you aware of this.

Support for `on: merge_group: types: [checks_requested]`

Is your feature request related to a problem? Please describe.
We would like to run this as part of a Merge queue check

on:
  merge_group:
    types: [checks_requested]

The docs say that only pull request events are supported.

Describe the solution you'd like

I want to be able to initiate this check with

on:
  merge_group:
    types: [checks_requested]

Describe alternatives you've considered
Writing my own check / contributing a PR

Some error in the ReadMe

Describe the bug
Some error into the ReadMe.

To Reproduce

steps:
- uses: Slashgear/[email protected]
  with:
    regex: '([a-z])+' # Regex the title should match.

Slashgear/[email protected]
regexp: '([a-z])+' # Regex the title should match.

Also, I am using Regex by default
regexp: '([a-z])+'
and it doesn't pass an error if I pass a title like this Dev/mibi/label action and Download

Node.js 16 is deprecated

GitHub is showing the following warning when this action is executed: Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: Slashgear/[email protected]. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/

feat(error): allow to present some passing examples on failure

Is your feature request related to a problem? Please describe.
When the action fails, the log shows the regex that's been used, but a regex is not super easy to read.

Describe the solution you'd like
I'd love to add an optional param to display some matching examples.

Example of better log:

Error: Pull Request title "(PIX-0000) Linter les titres de PR" failed to pass match regex - /\[[A-Z]+\] .+/

Example of matching titles:
- "[FEATURE] Migration des profils cibles (PIX-6596)"
- "[BUGFIX] Corriger l'erreur d'annΓ©e sur un test CPF (pix-6704)"
- "[TECH] Linter les titres de PR"

Another approach would be to redirect the user to the full rules (e.g.: a CONTRIBUTING.md file).

Describe alternatives you've considered
It should be possible to do it on my side by adding a "failure" step that catches the error and logs it itself.

Additional context
I've deployed this action in the Pix project :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.