mirror of
https://github.com/google/blockly.git
synced 2025-12-13 04:40:09 +01:00
chore: add commitlint workflow (#9409)
* chore: add commitlint workflow * chore: exit 1 on fail * chore: use builtin helpurl
This commit is contained in:
22
.github/workflows/conventional-label.yml
vendored
22
.github/workflows/conventional-label.yml
vendored
@@ -3,8 +3,28 @@ on:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
name: conventional-release-labels
|
||||
name: commit lint & label
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
contents: read
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: lts/*
|
||||
cache: npm
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
- name: Check PR title
|
||||
id: check-pr-title
|
||||
run: echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose
|
||||
|
||||
label:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
|
||||
39
commitlint.config.mjs
Normal file
39
commitlint.config.mjs
Normal file
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2018 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/**
|
||||
* Rules configuration for commitlint.
|
||||
* https://commitlint.js.org/reference/rules.html#subject-full-stop
|
||||
*
|
||||
* Extends the conventional-commit spec at
|
||||
* https://github.com/conventional-changelog/commitlint/tree/master/@commitlint/config-conventional
|
||||
*/
|
||||
|
||||
export default {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
rules: {
|
||||
// Warn if not in this list. Allow for judicious creativity.
|
||||
'type-enum': [
|
||||
1,
|
||||
'always',
|
||||
[
|
||||
'build',
|
||||
'chore',
|
||||
'ci',
|
||||
'docs',
|
||||
'feat',
|
||||
'fix',
|
||||
'refactor',
|
||||
'release',
|
||||
'revert',
|
||||
'test',
|
||||
],
|
||||
],
|
||||
'subject-case': [0],
|
||||
},
|
||||
helpUrl:
|
||||
'https://developers.google.com/blockly/guides/contribute/get-started/commits',
|
||||
};
|
||||
808
package-lock.json
generated
808
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -104,6 +104,8 @@
|
||||
"@blockly/dev-tools": "^9.0.2",
|
||||
"@blockly/keyboard-navigation": "^3.0.1",
|
||||
"@blockly/theme-modern": "^7.0.1",
|
||||
"@commitlint/cli": "^20.1.0",
|
||||
"@commitlint/config-conventional": "^20.0.0",
|
||||
"@hyperjump/browser": "^1.1.4",
|
||||
"@hyperjump/json-schema": "^1.5.0",
|
||||
"@microsoft/api-documenter": "7.22.4",
|
||||
|
||||
Reference in New Issue
Block a user