Skip to content

Commit

Permalink
ci: enable commitlinter with conventional rules
Browse files Browse the repository at this point in the history
Signed-off-by: Artsiom Koltun <[email protected]>
  • Loading branch information
artek-koltun committed Jul 18, 2023
1 parent 535f853 commit cf4024a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": [
"@commitlint/config-conventional"
]
}

26 changes: 26 additions & 0 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Commitlint

on:
pull_request:
branches:
- main

permissions:
contents: read

jobs:
commitlint:
if: ${{ github.event.pull_request.merged != true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 6: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 6: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
node-version: 20.x
- name: Install dependencies
run: npm i -g @commitlint/cli @commitlint/config-conventional
- name: Validate all commits from PR

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 6: npmCommand not pinned by hash
Click Remediation section below to solve this issue
run: commitlint --config ./.commitlintrc.json --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
16 changes: 16 additions & 0 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,19 @@ jobs:
- uses: golangci/golangci-lint-action@v3
with:
working-directory: .

commitlint:
if: ${{ github.event.pull_request.merged != true }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 6: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v2

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 6: GitHub-owned GitHubAction not pinned by hash
Click Remediation section below to solve this issue
with:
node-version: 20.x
- name: Install dependencies
run: npm i -g @commitlint/cli @commitlint/config-conventional
- name: Validate all commits from PR

Check warning

Code scanning / Scorecard

Pinned-Dependencies Medium

score is 6: npmCommand not pinned by hash
Click Remediation section below to solve this issue
run: commitlint --config ./.commitlintrc.json --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

0 comments on commit cf4024a

Please sign in to comment.