Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
seferov committed Aug 21, 2019
0 parents commit 05d40f9
Show file tree
Hide file tree
Showing 11 changed files with 918 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: PR lint

on: [pull_request]

jobs:
pr-lint:
runs-on: ubuntu-latest
steps:
- uses: seferov/pr-lint-action@master
with:
title-regex: '^\[[a-z ]*\] '
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib/
node_modules/
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"semi": true,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": false,
"arrowParens": "avoid",
"parser": "typescript"
}
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM node:slim

COPY . .

RUN npm install
RUN node_modules/typescript/bin/tsc

ENTRYPOINT ["node", "/lib/main.js"]
373 changes: 373 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Pull Request Lint

It is a linter of pull requests for [Github Actions](https://github.com/features/actions).

## Why?

To enforce pull request titles in the same format will be useful like generating standard changelog messages .
Besides it can be used to parse titles and link with issue tracking systems such as JIRA.

## Example:

```yaml
name: PR lint

on: [pull_request]

jobs:
pr-lint:
runs-on: ubuntu-latest
steps:
- uses: seferov/pr-lint-action@master
with:
title-regex: '^\[PROJECT-\d*\]\ '
```
In this example, for every pull request the title is expected to match `^\[PROJECT-\d*\]\ ` regex. For instance, `[PROJECT-123] lorem ipsum` or `[PROJECT-2345] dolor sit amet` are valid titles for this example. You can customize the title regex for your needs.
6 changes: 6 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name: 'PR Lint GitHub Action'
description: 'PR Lint for Github Actions'
author: 'Farhad Safarov'
runs:
using: 'docker'
image: 'Dockerfile'
Loading

0 comments on commit 05d40f9

Please sign in to comment.