Skip to content

Commit

Permalink
Fix template.
Browse files Browse the repository at this point in the history
  • Loading branch information
huxuan committed Feb 7, 2024
1 parent 2499a71 commit 8cd9130
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 36 deletions.
1 change: 1 addition & 0 deletions .gitlab/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ commitlint:
image:
name: commitlint/commitlint:latest
entrypoint: [""]
interruptible: true
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
Expand Down
1 change: 0 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"automodule",
"cobertura",
"commitlint",
"conventionalcommits",
"deepclean",
"deflist",
"devcontainer",
Expand Down
1 change: 1 addition & 0 deletions template/.commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };
4 changes: 3 additions & 1 deletion template/.vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"autofix",
"automodule",
"cobertura",
"commitlint",
"deepclean",
"deflist",
"devcontainer",
Expand All @@ -35,6 +36,7 @@
"maxdepth",
"modindex",
"mypy",
"noninteractive",
"pathjoin",
"pipenv",
"pipx",
Expand Down Expand Up @@ -151,7 +153,7 @@
],
"vscode-yaml-sort.noCompatMode": true,
"vscode-yaml-sort.sortOnSave": 2,
"vscode-yaml-sort.useArrayProcessor": false,
"vscode-yaml-sort.useArrayProcessor": true,
"vscode-yaml-sort.useBlockProcessor": false,
"vscode-yaml-sort.useCustomSortRecursively": true,
"vscode-yaml-sort.useHelmProcessor": false,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CommitLint
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
commitlint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: env | sort
- name: Install commitlint with conventional config
run: npm install --save-dev @commitlint/config-conventional @commitlint/cli
- name: Validate the latest commit message with commitlint
if: github.event_name == 'push'
run: echo "${{ github.event.head_commit.message }}" | npx commitlint
- name: Validate pull request title with commitlint
if: github.event_name == 'pull_request'
run: echo "${{ github.event.pull_request.title }}" | npx commitlint
on:
pull_request:
types:
- opened
- synchronize
- reopened
- edited
push:
branches:
- main

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
commitlint:
image:
name: commitlint/commitlint:latest
entrypoint: [""]
interruptible: true
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
script:
- |
if [ "$CI_PIPELINE_SOURCE" = "push" ]; then
echo "$CI_COMMIT_TITLE" | commitlint
elif [ "$CI_PIPELINE_SOURCE" = "merge_request_event" ]; then
echo "$CI_MERGE_REQUEST_TITLE" | commitlint
fi
stage: ci

This file was deleted.

0 comments on commit 8cd9130

Please sign in to comment.