From 1fc3897dabb3c178747d48a5672ac6a07d0bb4ef Mon Sep 17 00:00:00 2001 From: Aravind Vijayan Date: Wed, 29 Apr 2020 23:59:07 +0530 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..098411c --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,33 @@ +name: 'Commit Message Check' +on: + pull_request: + types: + - opened + - edited + - reopened + - synchronize + push: + branches: + - '*' + +jobs: + check-commit-message: + name: Check Commit Message + runs-on: ubuntu-latest + steps: + - name: Check Commit Type + uses: gsactions/commit-message-checker@v1 + with: + pattern: '\[[^]]+\] .+$' + flags: 'gm' + error: 'Your first line has to contain a commit type like "[BUGFIX]".' + - name: Check Line Length + uses: gsactions/commit-message-checker@v1 + with: + pattern: '^[^#].{74}' + error: 'The maximum line length of 74 characters is exceeded.' + - name: Check for Resolves / Fixes + uses: gsactions/commit-message-checker@v1 + with: + pattern: '^.+(Resolves|Fixes): \#[0-9]+$' + error: 'You need at least one "Resolves|Fixes: #" line.'