-
Notifications
You must be signed in to change notification settings - Fork 179
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ci: Add Conventional Commit Lint #821
Closed
arielvalentin
wants to merge
23
commits into
open-telemetry:main
from
arielvalentin:add-commitlint-gh-action
+69
−0
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
b54c6df
ci: Add Conventional Commit Lint
arielvalentin 12f2ccd
squash: Allow commits targeted to squash
arielvalentin 6eebddb
squash: oops
arielvalentin 42581d7
squash: Lint title
arielvalentin 17610f8
squash: lets do these out of order
arielvalentin 25bea35
squash: split up linters
arielvalentin 743f964
squash: relocate files
arielvalentin 5359c0b
squash: relocate files
arielvalentin c42a252
squash: does this work
arielvalentin f0dee68
squash: trigger gosh darn you
arielvalentin 8d70d90
squash: try again
arielvalentin 2d3a4b4
squash: is issue writing required?
arielvalentin 6a8066c
squash: read
arielvalentin 6b1a93d
squash: force token
arielvalentin f4d2804
squash: wrong level
arielvalentin 036e5f2
squash: switch to per job permissions
arielvalentin 2d8de9e
squash: wtf
arielvalentin 7acb938
squash: grasping at straws
arielvalentin 5509522
squash: wtf
arielvalentin 7051307
squash: wth
arielvalentin 61d5aa1
squash: i give up
arielvalentin d8cdc79
squash: I do not want to deal with permissions
arielvalentin d0af13e
Merge branch 'main' into add-commitlint-gh-action
arielvalentin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,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' | ||
] | ||
] | ||
} | ||
}; |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind if we alphabetize this list?
Also, the list in
commitlint.config.js
also includesrevert
andsquash
. Should those be here too?