generated from opentensor/bittensor-subnet-template
-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CSN-506): Add commitlint workflow config
Enable commitlint action.
- Loading branch information
1 parent
5119cdc
commit e7b9d0a
Showing
1 changed file
with
31 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,31 @@ | ||
name: commitlint | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
commitlint: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Install required dependencies | ||
run: | | ||
sudo apt-get install -y nodejs npm | ||
- name: Print versions | ||
run: | | ||
git --version | ||
node --version | ||
npm --version | ||
npx commitlint --version | ||
- name: Install commitlint | ||
run: | | ||
npm install --save-dev @commitlint/config-conventional @commitlint/cli | ||
- name: Validate current commit (last commit) with commitlint | ||
if: github.event_name == 'push' | ||
run: npx commitlint --last --verbose | ||
|
||
- name: Validate PR commits with commitlint | ||
if: github.event_name == 'pull_request' | ||
run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose |