-
Notifications
You must be signed in to change notification settings - Fork 5
53 lines (49 loc) · 2.04 KB
/
commit-lint.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# commit-lint needs "pull_request_target" access,
# therefore separate from main ci.yml
name: PR
on:
push:
branches-ignore:
- '**' # temporally ignore all, as https://github.com/wagoid/commitlint-github-action/issues/66
jobs:
commit-lint-check:
runs-on: ubuntu-latest
steps:
- name: find the prev warning if exist
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'bad commit message'
- name: Delete comment if exist
if: ${{ steps.fc.outputs.comment-id != 0 }}
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: ${{ steps.fc.outputs.comment-id }},
})
- uses: actions/[email protected]
with:
fetch-depth: 0
- run: "echo \"module.exports = {extends: ['@commitlint/config-conventional']}\" > commitlint.config.js"
- uses: wagoid/commitlint-github-action@v1
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: if lint failed
if: ${{ failure() }}
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Thanks for your contribution :heart:
:broken_heart: Unfortunately, this PR has one ore more **bad commit messages**, it can not be merged. To fix this problem, please refer to:
- Commit Message Guideline for the First Time Contributor
- [Contributing Guideline](https://github.com/marieai/marie-ai/blob/main/CONTRIBUTING.md)
Note, other CI tests will *not* *start* until the commit messages get fixed.
This message will be deleted automatically when the commit messages get fixed.
reaction-type: "eyes"