Skip to content
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(commitlint): rewrite commitlint #50

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from
47 changes: 47 additions & 0 deletions .commitlintrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import {
RuleConfigCondition,
RuleConfigSeverity,
TargetCaseType,
} from '@commitlint/types';

export default {
parserPreset: 'conventional-changelog-conventionalcommits',
rules: {
'body-leading-blank': [RuleConfigSeverity.Warning, 'always'] as const,
'body-max-line-length': [RuleConfigSeverity.Error, 'always', 70] as const,
'footer-leading-blank': [RuleConfigSeverity.Warning, 'always'] as const,
'footer-max-line-length': [
RuleConfigSeverity.Error,
'always',
70,
] as const,
'header-max-length': [RuleConfigSeverity.Error, 'always', 70] as const,
'header-trim': [RuleConfigSeverity.Error, 'always'] as const,
'subject-case': [
RuleConfigSeverity.Error,
'never',
['sentence-case', 'start-case', 'pascal-case', 'upper-case'],
] as [RuleConfigSeverity, RuleConfigCondition, TargetCaseType[]],
'subject-empty': [RuleConfigSeverity.Error, 'never'] as const,
'subject-full-stop': [RuleConfigSeverity.Error, 'never', '.'] as const,
'type-case': [RuleConfigSeverity.Error, 'always', 'lower-case'] as const,
'type-empty': [RuleConfigSeverity.Error, 'never'] as const,
'type-enum': [
RuleConfigSeverity.Error,
'always',
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test',
],
] as [RuleConfigSeverity, RuleConfigCondition, string[]],
}
};
20 changes: 10 additions & 10 deletions .github/workflows/cachix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ on:
push:
branches-ignore:
- "renovate/**"
paths-ignore:
- "docs/**"
paths-ignore:
- "docs"
- "**.md"
- "**/LICENSE"
- "flake.lock"
- "packages/**"
- ".github/ISSUE_TEMPLATE/**"
- ".markdownlint**"
- "packages"
- ".github/ISSUE_TEMPLATE"
- ".markdownlint"
pull_request:
paths-ignore:
- "docs/**"
- "docs"
- "**.md"
- "**/LICENSE"
- "flake.lock"
- "packages/**"
- ".github/ISSUE_TEMPLATE/**"
- ".markdownlint**"
- "packages"
- ".github/ISSUE_TEMPLATE"
- ".markdownlint"
workflow_dispatch:

jobs:
build-and-cache:
runs-on: ubuntu-latest
Expand Down
31 changes: 27 additions & 4 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,36 @@
name: Commit verification
name: Commit lint

on: [push, pull_request]

jobs:
commitlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4.2.2
with:
fetch-depth: 0
- name: Validate Commits with Commitlint
uses: joberstein/actions-commitlint-validation@v1-dist
- name: Install required dependencies
run: |
sudo apt update
sudo apt install -y sudo
sudo apt install -y git curl
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
DEBIAN_FRONTEND=noninteractive sudo apt install -y nodejs
- name: Debug [Versions]
run: |
git --version
node --version
npm --version
npx commitlint --version
- name: Install commitlint
run: |
npm install conventional-changelog-conventionalcommits
npm install commitlint@latest

- 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
19 changes: 9 additions & 10 deletions .github/workflows/trigger_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,22 @@ on:
push:
branches-ignore:
- "renovate/**"
paths-ignore:
- "docs/**"
paths-ignore:
- "docs"
- "**.md"
- "**/LICENSE"
- "flake.lock"
- "packages/**"
- ".github/ISSUE_TEMPLATE/**"
- ".markdownlint**"
- "packages"
- ".github/ISSUE_TEMPLATE"
- ".markdownlint"
pull_request:
paths-ignore:
- "docs/**"
- "docs"
- "**.md"
- "**/LICENSE"
- "flake.lock"
- "packages/**"
- ".github/ISSUE_TEMPLATE/**"
- ".markdownlint**"
- "packages"
- ".github/ISSUE_TEMPLATE"
- ".markdownlint"
workflow_dispatch:

jobs:
Expand Down
16 changes: 12 additions & 4 deletions .github/workflows/update-flake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,15 @@ jobs:
commit-msg: "chore(nix): update lockfile"
pr-title: "chore(nix): update lockfile"
pr-labels: |
Linux
packaging
simple change
changelog:omit
[0] : Freesm
[1] : Nix-related
[2] : Chore (other)
[3] : Priority: Low
[4] : Complexity: Easy
[5] : Status: Done
[6] : Platform: Linux
[6] : Platform: macOS
[7] : Component: Code (other)
[8] : User: End-Users
[9] : Bug: None
[10] : Pull Request
Loading