-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c10d02
commit cdaa8e2
Showing
4 changed files
with
105 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"include-pull-requests": true, | ||
"types": [ "chore", "ci", "docs", "feat", "fix", "perf", "refactor", "release", "squash", "test" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: Conventional Commits Validation | ||
|
||
on: | ||
workflow_dispatch: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- edited | ||
|
||
permissions: | ||
contents: read | ||
pull-requests: read | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request | ||
cancel-in-progress: true # Cancel any previous runs of this workflow | ||
|
||
jobs: | ||
validate-commits: | ||
name: Conventional Commits Validation | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dev-build-deploy/commit-me@v1.3.1 | ||
env: | ||
FORCE_COLOR: 3 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
include-commits: true | ||
update-labels: false | ||
config: ".commit-me.json" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: "Lint Conventional Commits" | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
- reopened | ||
- edited | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number }} # Ensure that only one instance of this workflow is running per Pull Request | ||
cancel-in-progress: true # Cancel any previous runs of this workflow | ||
|
||
jobs: | ||
main: | ||
name: Lint Conventional Commits | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5.4.0 | ||
name: "🤖 Check PR title follows conventional commit spec" | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
# Have to specify all types because `maint` and `rel` aren't defaults | ||
types: | | ||
fix | ||
feat | ||
chore | ||
ci | ||
docs | ||
style | ||
refactor | ||
perf | ||
test | ||
- uses: actions/checkout@v4.1.1 | ||
- uses: wagoid/commitlint-github-action@v5.4.5 | ||
name: "🤖 Check commit messages follow conventional commit spec" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'subject-case': [ | ||
2, | ||
'never', | ||
[ | ||
'upper-case', | ||
'pascal-case', | ||
] | ||
], | ||
'type-enum': [ | ||
2, | ||
'always', | ||
[ | ||
'chore', | ||
'ci', | ||
'docs', | ||
'feat', | ||
'fix', | ||
'perf', | ||
'refactor', | ||
'revert', | ||
'squash', | ||
'style', | ||
'test' | ||
] | ||
] | ||
} | ||
}; |