Git Product home page Git Product logo

action-pr-title's Introduction

Usage

steps:
  - uses: msutkowski/action-pr-title@v1
    with:
      regex: '([a-z])+\/([a-z])+' # Regex to test the PR title against
      max_length: 20 # Max length of the title
      hint: 'PR titles should match a format like: fix: [ABC-1234] some description' # A hint for the desired format
      github_token: ${{ github.token }} # Default: ${{ github.token }}

Note:

Ensure to add types to the Pull requests webhook event as by default workflows are triggered only for opened, synchronize, or reopened pull request events. Read more about it here.

name: PR title check

on:
  pull_request:
    types: [opened, edited, synchronize, reopened]

jobs:
  check_title:
    runs-on: ubuntu-latest
    steps:
      - name: Enforce PR naming convention
        uses: msutkowski/action-pr-title@v1
        with:
          regex: '^(fix|feat|chore|(fix|feat|chore)\(\w.*\)):\s(\[\w{1,8}-\d{1,8}\]|.*).*'
          hint: |
            You can pass the following formats:

            fix: [OR-123] some title of the PR
            fix(scope): [OR-123] some title of the PR
            feat: [OR-1234] some title of the PR
            chore: update some action

Code in Main

First, you'll need to have a reasonably modern version of node handy. This won't work with versions older than 9, for instance.

Install the dependencies

$ npm install

Build the typescript and package it for distribution

$ npm run build && npm run package

...


See the [toolkit documentation](https://github.com/actions/toolkit/blob/master/README.md#packages) for the various packages.

## Publish to a distribution branch

Actions are run from GitHub repos so we will checkin the packed dist folder.

Then run [ncc](https://github.com/zeit/ncc) and push the results:

```bash
$ npm run package
$ git add dist
$ git commit -a -m "prod dependencies"
$ git push origin releases/v1

Note: We recommend using the --license option for ncc, which will create a license file for all of the production node modules used in your project.

Your action is now published! ๐Ÿš€

See the versioning documentation

Usage:

After testing you can create a v1 tag to reference the stable and latest V1 action

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.