Skip to content

Commit d33bd38

Browse files
chore(action): auto validate this repository
1 parent e131025 commit d33bd38

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: 'Commit message validation on pull request'
2+
3+
on:
4+
pull_request
5+
6+
jobs:
7+
commit-message-validation:
8+
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Commit message validation
16+
uses: lumapps/commit-message-validator@master
17+
with:
18+
no_jira: 1
19+
env:
20+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ Thus we won't enforce one or the other, we will only enfore:
148148

149149
<!-- GETTING STARTED -->
150150

151-
## Getting Started
151+
## Getting Started with command line
152152

153153
To get a local copy up and running follow these simple steps.
154154

@@ -202,6 +202,36 @@ in `.git/hooks` directory of your repository.
202202
- if `COMMIT_VALIDATOR_NO_JIRA` environment variable is set, no validation is done on JIRA refs.
203203
- if `COMMIT_VALIDATOR_ALLOW_TEMP` environment variable is set, no validation is done on `fixup!` and `squash!` commits.
204204

205+
## Getting Started with github action
206+
207+
To enable the action simply create the .github/workflows/commit-message-validator.yml file with the following content:
208+
209+
```yml
210+
name: 'Commit message validation on pull request'
211+
212+
on:
213+
pull_request
214+
215+
jobs:
216+
commit-message-validation:
217+
218+
runs-on: ubuntu-latest
219+
220+
steps:
221+
- name: Checkout
222+
uses: actions/checkout@v2
223+
224+
- name: Commit message validation
225+
uses: lumapps/commit-message-validator@master
226+
env:
227+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
228+
```
229+
230+
### OPTIONS
231+
232+
- if `no_jira` is not empty, no validation is done on JIRA refs.
233+
- if `allow_temp` is not empty, no validation is done on `fixup!` and `squash!` commits.
234+
205235
<!-- ROADMAP -->
206236

207237
## Roadmap

action.yml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: 'Commit message validator'
2+
description: 'Enforce angular commit message convention with minimal dependancy only git and bash.'
3+
author: 'Sébastien Boulle'
4+
branding:
5+
icon: 'check-square'
6+
color: 'green'
7+
inputs:
8+
no_jira:
9+
description: 'If not empty, no validation is done on JIRA refs.'
10+
required: false
11+
allow_temp:
12+
description: 'If not empty, no validation is done on `fixup!` and `squash!` commits.'
13+
required: false
14+
runs:
15+
using: "composite"
16+
steps:
17+
- name: Ensure that base is fetched
18+
run: git fetch origin ${{ github.event.pull_request.base.sha }}
19+
shell: bash
20+
21+
- name: Ensure that head is fetched
22+
run: git fetch origin ${{ github.event.pull_request.head.sha }}
23+
shell: bash
24+
25+
- name: Validation
26+
run: ${{ github.action_path }}/check.sh ${{ github.event.pull_request.base.sha }}..${{ github.event.pull_request.head.sha }}
27+
env:
28+
no_jira: ${{ inputs.no_jira }}
29+
allow_temp: ${{ inputs.allow_temp }}
30+
shell: bash

0 commit comments

Comments
 (0)