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: add commitlint fp-34 #37

Merged
merged 6 commits into from
Dec 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 70 additions & 0 deletions .github/workflows/ci-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Continuous Integration Pull Request

on:
pull_request:
types:
- assigned
- unassigned
- opened
- edited
- synchronize
- reopened
- labeled
- unlabeled
- ready_for_review

concurrency:
group: ci-pr-${{ github.ref }}
cancel-in-progress: true

jobs:
dependencies:
name: Install Dependencies
runs-on: ubuntu-latest
steps:
- name: Code Checkout
uses: actions/checkout@v4

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Cache Dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ci-pr-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
ci-pr-

- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
npm install

lint:
name: Pull Request Linting
needs: dependencies
runs-on: ubuntu-latest

steps:
- name: Checkout Source Code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Install NodeJS
uses: actions/setup-node@v4
with:
node-version-file: .nvmrc

- name: Restore Dependencies
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ci-pr-${{ hashFiles('**/package-lock.json') }}

- name: Lint Commits
uses: wagoid/commitlint-github-action@v5
27 changes: 0 additions & 27 deletions .github/workflows/notify.yml

This file was deleted.

1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
18 changes: 18 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { RuleConfigSeverity } from '@commitlint/types';

const PROJECT_PREFIXES = /** @type {const} */ ([`fp`, `release`]);

/** @type {import('@commitlint/types').UserConfig} */
let configuration = {
extends: [`@commitlint/config-conventional`],
parserPreset: {
parserOpts: {
issuePrefixes: PROJECT_PREFIXES.map((it) => `${it}-`),
},
},
rules: {
'references-empty': [RuleConfigSeverity.Error, `never`],
},
};

export default configuration;
Loading