Coder Social home page Coder Social logo

pratool / pr-lint-action Goto Github PK

View Code? Open in Web Editor NEW

This project forked from morrisoncole/pr-lint-action

0.0 1.0 0.0 469 KB

:octocat: A TypeScript GitHub Action to ensure that your PR title matches a given regex.

Home Page: https://morrisoncole.co.uk

License: MIT License

Dockerfile 3.02% TypeScript 82.56% JavaScript 14.43%

pr-lint-action's Introduction

Pull Request Linter code style: prettier

A GitHub Action to ensure that your PR title matches a given regex.

Usage

Create a workflow definition at .github/workflows/<my-workflow>.yml with something like the following contents:

name: PR Lint

on:
  pull_request:
    # By default, a workflow only runs when a pull_request's activity type is opened, synchronize, or reopened. We
    # explicity override here so that PR titles are re-linted when the PR text content is edited.
    #
    # Possible values: https://help.github.com/en/actions/reference/events-that-trigger-workflows#pull-request-event-pull_request
    types: [opened, edited, reopened]

jobs:
  pr-lint:
    runs-on: ubuntu-latest
    steps:
      - uses: morrisoncole/[email protected]
        with:
          title-regex: "#[eE][xX]-[0-9]+"
          on-failed-regex-fail-action: false
          on-failed-regex-request-changes: false
          on-failed-regex-create-review: true
          on-failed-regex-comment:
            "This is just an example. Failed regex: `%regex%`!"
          repo-token: "${{ secrets.GITHUB_TOKEN }}"

Changelog

v1.4.0

  • Adds #119 (thanks @bryantbiggs! ๐Ÿ™) the ability to configure whether changes are requested or not with on-failed-regex-request-changes. Existing behaviour is preserved.
  • Upgrades all dependencies.

v1.3.0

  • Adds #111, the ability to specify whether to create a review and whether to fail the action on a regex mismatch independently with on-failed-regex-fail-action & on-failed-regex-create-review.
  • on-failed-regex-comment is no longer a required input.

Note: existing behaviour from previous releases is preserved without additional configuration ๐Ÿ™.

v1.2.3

Internal refactoring only:

  • Upgrade dependencies.
  • Move from lib to dist.
  • Address ESLint warnings.

v1.2.2

v1.2.1

v1.1.1

Internal refactoring only:

  • Upgrade dependencies.
  • Configure ESLint & Prettier.

v1.1.0

  • Replaced status checks with an automatic bot review. If the PR title fails to match the regex, the bot will request changes. Once the title is edited to match it, the bot will dismiss its review.
  • Upgrade dependencies.

v1.0.0

  • Initial release. This version uses action status checks but suffers from #5 since the GitHub actions API treats different hook types as separate checks by default.

FAQ

Why doesn't this Action use status checks any more?

Since actions are currently not grouped together, previously failed status checks were persisted despite newer runs succeeding (reported in #5). We made the decision to use a bot-based 'request changes' workflow for the time being.

Developing

Build

yarn install

yarn build

Building outputs to dist/main.js.

Related Reading

pr-lint-action's People

Contributors

bryantbiggs avatar dependabot[bot] avatar morrisoncole avatar negebauer avatar renovate-bot avatar renovate[bot] avatar

Watchers

 avatar

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.