mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-10-22 04:18:53 +00:00
So that we can see as many errors as possible at once. Signed-off-by: Tim Zhang <tim@hyper.sh>
74 lines
2.3 KiB
YAML
74 lines
2.3 KiB
YAML
name: Commit Message Check
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- reopened
|
|
- synchronize
|
|
|
|
env:
|
|
error_msg: |+
|
|
See the document below for help on formatting commits for the project.
|
|
|
|
https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md#patch-forma
|
|
|
|
jobs:
|
|
commit-message-check:
|
|
runs-on: ubuntu-latest
|
|
name: Commit Message Check
|
|
steps:
|
|
- name: Get PR Commits
|
|
id: 'get-pr-commits'
|
|
uses: tim-actions/get-pr-commits@v1.0.0
|
|
with:
|
|
token: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
- name: DCO Check
|
|
uses: tim-actions/dco@2fd0504dc0d27b33f542867c300c60840c6dcb20
|
|
with:
|
|
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
|
|
|
- name: Commit Body Missing Check
|
|
if: ${{ success() || failure() }}
|
|
uses: tim-actions/commit-body-check@v1.0.2
|
|
with:
|
|
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
|
|
|
- name: Check Subject Line Length
|
|
if: ${{ success() || failure() }}
|
|
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
|
|
with:
|
|
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
|
pattern: '^.{0,75}(\n.*)*$'
|
|
error: 'Subject too long (max 75)'
|
|
post_error: ${{ env.error_msg }}
|
|
|
|
- name: Check Body Line Length
|
|
if: ${{ success() || failure() }}
|
|
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
|
|
with:
|
|
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
|
pattern: '^.+(\n.{0,72})*$|^.+\n\s*[^a-zA-Z\s\n]|^.+\n\S+$'
|
|
error: 'Body line too long (max 72)'
|
|
post_error: ${{ env.error_msg }}
|
|
|
|
- name: Check Fixes
|
|
if: ${{ success() || failure() }}
|
|
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
|
|
with:
|
|
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
|
pattern: '\s*Fixes\s*:?\s*(#\d+|github\.com\/kata-containers\/[a-z-.]*#\d+)'
|
|
flags: 'i'
|
|
error: 'No "Fixes" found'
|
|
post_error: ${{ env.error_msg }}
|
|
one_pass_all_pass: 'true'
|
|
|
|
- name: Check Subsystem
|
|
if: ${{ success() || failure() }}
|
|
uses: tim-actions/commit-message-checker-with-regex@v0.3.1
|
|
with:
|
|
commits: ${{ steps.get-pr-commits.outputs.commits }}
|
|
pattern: '^[\h]*([^:\h\n]+)[\h]*:'
|
|
error: 'Failed to find subsystem in subject'
|
|
post_error: ${{ env.error_msg }}
|