Skip to content

Commit

Permalink
Merge pull request #3 from aschbacd/feature-enhance-default-values
Browse files Browse the repository at this point in the history
Enhance default values
  • Loading branch information
aschbacd authored Dec 3, 2021
2 parents f82c9bf + 6065791 commit 3a4c580
Show file tree
Hide file tree
Showing 5 changed files with 415 additions and 28 deletions.
47 changes: 23 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,41 +21,40 @@ jobs:
name: GitLint
steps:
- name: Lint commits, branches, and pull requests
uses: aschbacd/gitlint-action@v1.0.1
uses: aschbacd/gitlint-action@v1.0.2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
commit-message-body-max-length: 72
commit-message-subject-max-length: 50
prohibit-unknown-commit-authors: true
prohibit-unknown-commit-committers: true
re-commit-message-subject: "^[A-Z].*((?!\\.).)$"
re-pull-request-title: "^[A-Z].*((?!\\.).)$"
re-commit-message-subject: ^[A-Z].*((?!\.).)$
re-pull-request-title: ^[A-Z].*((?!\.).)$
```
## Customization
The following input keys can be used in your GitHub Actions workflow (shown above).
| Key | Description | Default | Recommended |
| ---------------------------------- | ------------------------------------------------------------ | ----------------------- | ----------------------------- |
| commit-message-body-max-length | Max. characters for line in commit message body | -1 (disabled) | 72 |
| commit-message-body-min-length | Min. characters for line in commit message body | -1 (disabled) | -1 (disabled) |
| commit-message-subject-max-length | Max. characters for commit message subject | -1 (disabled) | 50 |
| commit-message-subject-min-length | Min. characters for commit message subject | -1 (disabled) | -1 (disabled) |
| github-token | Token used to authenticate against GitHub api | `-` | `${{ secrets.GITHUB_TOKEN }}` |
| prohibit-blank-lines-cm-body | Commit message body cannot include blank lines | `false` | `false` |
| prohibit-unknown-commit-authors | Commit author must be GitHub user | `false` | `true` |
| prohibit-unknown-commit-committers | Commit committer must be GitHub user | `false` | `true` |
| prohibit-unsigned-commits | Commits without a valid signature are invalid | `false` | `false` |
| re-branch-name | Regex used to check branch name | `.*` | `[a-z]+\/.+` |
| re-commit-author-email | Regex used to check commit author email | `.*` | `.*` |
| re-commit-author-name | Regex used to check commit author name | `.*` | `.*` |
| re-commit-committer-email | Regex used to check commit committer email | `.*` | `.*` |
| re-commit-committer-name | Regex used to check commit committer name | `.*` | `.*` |
| re-commit-message-body | Regex used to check commit message body (DotAll) | `.*` | `.*` |
| re-commit-message-split | Regex used to split commit message subject and body (DotAll) | `([^\n]*)(?:\n\n(.*))?` | `([^\n]*)(?:\n\n(.*))?` |
| re-commit-message-subject | Regex used to check commit message subject | `.*` | `^[A-Z].*((?!\.).)$` |
| re-pull-request-title | Regex used to check pull request title | `.*` | `^[A-Z].*((?!\.).)$` |
| Key | Description | Default | Recommended |
| ---------------------------------- | ------------------------------------------------------------ | ----------------------- | ----------------------- |
| commit-message-body-max-length | Max. characters for line in commit message body | -1 (disabled) | 72 |
| commit-message-body-min-length | Min. characters for line in commit message body | -1 (disabled) | -1 (disabled) |
| commit-message-subject-max-length | Max. characters for commit message subject | -1 (disabled) | 50 |
| commit-message-subject-min-length | Min. characters for commit message subject | -1 (disabled) | -1 (disabled) |
| github-token | Token used to authenticate against GitHub api | `${{ github.token }}` | `${{ github.token }}` |
| prohibit-blank-lines-cm-body | Commit message body cannot include blank lines | `false` | `false` |
| prohibit-unknown-commit-authors | Commit author must be GitHub user | `false` | `true` |
| prohibit-unknown-commit-committers | Commit committer must be GitHub user | `false` | `true` |
| prohibit-unsigned-commits | Commits without a valid signature are invalid | `false` | `false` |
| re-branch-name | Regex used to check branch name | `.*` | `.*` |
| re-commit-author-email | Regex used to check commit author email | `.*` | `.*` |
| re-commit-author-name | Regex used to check commit author name | `.*` | `.*` |
| re-commit-committer-email | Regex used to check commit committer email | `.*` | `.*` |
| re-commit-committer-name | Regex used to check commit committer name | `.*` | `.*` |
| re-commit-message-body | Regex used to check commit message body (DotAll) | `.*` | `.*` |
| re-commit-message-split | Regex used to split commit message subject and body (DotAll) | `([^\n]*)(?:\n\n(.*))?` | `([^\n]*)(?:\n\n(.*))?` |
| re-commit-message-subject | Regex used to check commit message subject | `.*` | `^[A-Z].*((?!\.).)$` |
| re-pull-request-title | Regex used to check pull request title | `.*` | `^[A-Z].*((?!\.).)$` |

## Resources

Expand Down
3 changes: 2 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: "GitLint Action"
description: "Check if naming conventions for commits, branches, and PRs are respected"
description: "Check if naming conventions for commits, branches, and pull requests are respected"
branding:
icon: "check"
color: "blue"
Expand All @@ -23,6 +23,7 @@ inputs:
github-token:
description: "GitHub token used to access api"
required: true
default: ${{ github.token }}
prohibit-blank-lines-cm-body:
description: "Prohibit blank lines in commit message body"
required: false
Expand Down
192 changes: 192 additions & 0 deletions node_modules/.package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3a4c580

Please sign in to comment.