-
Notifications
You must be signed in to change notification settings - Fork 4
35 lines (34 loc) · 1.57 KB
/
check_commits.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
name: 'Commit Checks'
on:
pull_request:
types:
- opened
- edited
- reopened
- synchronize
jobs:
check-commit-message:
name: Check Commit Message
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Get PR Commits
id: 'get-pr-commits'
uses: tim-actions/get-pr-commits@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Check conventional commits
uses: tim-actions/[email protected]
with:
commits: ${{ steps.get-pr-commits.outputs.commits }}
pattern: '^(Merge pull request #[0-9]+ from dodevops/develop)|(Merge branch ''main'' into develop)|(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)'
error: 'Commit messages do not follow https://www.conventionalcommits.org/en/v1.0.0/'
- name: Get Changed Files
uses: tj-actions/[email protected]
- name: Check if CHANGELOG wasn't included
run: |
if echo ${{ steps.changed-files.outputs.all_changed_files }} | grep CHANGELOG.md; then
echo "::error file=CHANGELOG.md,title=CHANGELOG was modified::Please don't modify the changelog. It will be automatically updated when the changes are released."
fi