Skip to content

Commit 2e8e9a4

Browse files
authored
Merge pull request #1 from wagoid/feat/create-action
Feat/create action
2 parents 083d214 + d65bd96 commit 2e8e9a4

File tree

10 files changed

+2163
-1
lines changed

10 files changed

+2163
-1
lines changed

.github/workflows/commitlint.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
name: Commitlint
2+
on: [pull_request]
3+
4+
jobs:
5+
commitlint:
6+
runs-on: ubuntu-latest
7+
env:
8+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9+
steps:
10+
- uses: actions/checkout@v1
11+
- uses: ./

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"trailingComma": "all",
3+
"tabWidth": 2,
4+
"semi": false,
5+
"singleQuote": true
6+
}

Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:10
2+
3+
COPY package*.json /
4+
5+
RUN npm ci --production
6+
7+
COPY . .
8+
9+
ENTRYPOINT ["/entrypoint.sh"]

README.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,40 @@
1-
# commitlint-pr-action
1+
# Commitlint Github Action
2+
23
Lints Pull Request commits with commitlint
4+
5+
## Usage
6+
7+
Create a github workflow in the `.github` folder, e.g. `.github/workflows/commitlint.yml`:
8+
9+
```yaml
10+
name: Commitlint
11+
on: [pull_request]
12+
13+
jobs:
14+
commitlint:
15+
runs-on: ubuntu-latest
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
steps:
19+
- uses: actions/checkout@v1
20+
- uses: wagoid/[email protected]
21+
```
22+
23+
## Inputs
24+
25+
### `configFile`
26+
27+
The path to your commitlint config file. Default `commitlint.config.js`.
28+
29+
## About `extends` in your config file
30+
31+
This is a [`Docker` action](https://github.com/actions/toolkit/blob/e2adf403d6d14a9ca7474976ccaca20f72ff8209/docs/action-types.md#why-would-i-choose-a-docker-action), and was made like this so that you can run it with minimum setup, regardless of your repo's environment. It comes packed with the most famous shared configurations that you can use in your commitlint config's `extends` field:
32+
33+
- [@commitlint/config-angular](./@commitlint/config-angular)
34+
- [@commitlint/config-conventional](./@commitlint/config-conventional)
35+
- [@commitlint/config-lerna-scopes](./@commitlint/config-lerna-scopes)
36+
- [@commitlint/config-patternplate](./@commitlint/config-patternplate)
37+
- [conventional-changelog-lint-config-canonical](https://github.com/gajus/conventional-changelog-lint-config-canonical)
38+
- [commitlint-config-jira](https://github.com/Gherciu/commitlint-jira)
39+
40+
If you have a custom shared config that lies in a private registry, let us know! We will be happy to cover this case if necessary.

action.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: 'Commitlint'
2+
description: 'Lints commit messages with commitlint'
3+
author: 'Wagner Santos'
4+
inputs:
5+
configFile:
6+
description: 'commitlint config file'
7+
default: './commitlint.config.js'
8+
runs:
9+
using: 'docker'
10+
image: 'Dockerfile'
11+
branding:
12+
icon: 'check-square'
13+
color: 'blue'

commitlint.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional'],
3+
}

entrypoint.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/sh
2+
3+
set -e
4+
5+
cd ${GITHUB_WORKSPACE}
6+
7+
NODE_PATH=/node_modules node /run.js

0 commit comments

Comments
 (0)