@adbayb/stack 2.6.2 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -22
- package/configs/eslint/README.md +3 -3
- package/configs/eslint/presets/import.js +4 -1
- package/configs/eslint/presets/react.js +2 -1
- package/configs/eslint/presets/test.js +6 -2
- package/configs/eslint/presets/typescript.js +14 -5
- package/configs/eslint/presets/uncategorized.js +16 -2
- package/configs/eslint/presets/unicorn.js +4 -1
- package/configs/prettier/README.md +5 -5
- package/configs/prettier/index.js +1 -1
- package/configs/typescript/README.md +3 -3
- package/dist/index.js +2 -4
- package/package.json +1 -1
- package/templates/multi-projects/.editorconfig +1 -1
- package/templates/multi-projects/.github/ISSUE_TEMPLATE/config.yml +2 -2
- package/templates/multi-projects/.github/workflows/continuous_delivery.yml +54 -54
- package/templates/multi-projects/.github/workflows/continuous_integration.yml +4 -4
- package/templates/multi-projects/.github/workflows/conventional_commit.yml +43 -43
- package/templates/multi-projects/.github/workflows/dependency_changelog.yml +112 -112
- package/templates/multi-projects/.github/workflows/workflow.yml +34 -34
- package/templates/multi-projects/examples/README.md +2 -2
- package/templates/single-project/.editorconfig +1 -1
- package/templates/single-project/.github/ISSUE_TEMPLATE/config.yml +2 -2
- package/templates/single-project/.github/workflows/continuous_delivery.yml +54 -54
- package/templates/single-project/.github/workflows/continuous_integration.yml +4 -4
- package/templates/single-project/.github/workflows/conventional_commit.yml +43 -43
- package/templates/single-project/.github/workflows/dependency_changelog.yml +112 -112
- package/templates/single-project/.github/workflows/workflow.yml +34 -34
- package/templates/single-project/examples/README.md +2 -2
package/README.md
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
`Stack` allows creating an NPM project in a **quick**, **easy** and **opinionated** way with:
|
|
11
11
|
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
-
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
12
|
+
- A unified monorepo-driven and git-driven approach for all kinds of projects (single-purpose library, multiple libraries, application(s), ...)
|
|
13
|
+
- Support for several application templates (for now, only a default template is available, but others can be added later)
|
|
14
|
+
- Standardized file structure including optional folder creation such as `examples`, `packages`, ...
|
|
15
|
+
- Enable all project lifecycle steps with commands from the setup, check, fix, build, and test to the versioning and release
|
|
16
|
+
- Built-in configuration preset setup (including Node/NPM runtime, Git ignore/hooks, [TypeScript](https://github.com/adbayb/stack/blob/main/stack/configs/typescript/), [ESLint](https://github.com/adbayb/stack/blob/main/stack/configs/eslint/), [Prettier](https://github.com/adbayb/stack/blob/main/stack/configs/prettier/), EditorConfig, Renovate, Changesets, and VSCode)
|
|
17
|
+
- A welcoming environment for users and contributors with the continuous integration setup, and the creation of `README.md`, `CONTRIBUTING.md`, and GitHub template files (including issue and pull request ones), ...
|
|
18
|
+
- An optimized development environment with command caching (no build needed if nothing changes)
|
|
19
19
|
|
|
20
20
|
<br>
|
|
21
21
|
|
|
@@ -63,27 +63,27 @@ stack release
|
|
|
63
63
|
|
|
64
64
|
### Available configurations
|
|
65
65
|
|
|
66
|
-
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
66
|
+
- [@adbayb/stack/eslint](https://github.com/adbayb/stack/blob/main/stack/configs/eslint/) to align logical and stylistic rules across projects.
|
|
67
|
+
- [@adbayb/stack/prettier](https://github.com/adbayb/stack/blob/main/stack/configs/prettier/) to align code formatting conventions across projects.
|
|
68
|
+
- [@adbayb/stack/typescript](https://github.com/adbayb/stack/blob/main/stack/configs/typescript/) to align type checking and processing across projects.
|
|
69
69
|
|
|
70
70
|
### Used technologies
|
|
71
71
|
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
72
|
+
- **Static code analysis**: ESLint, Prettier
|
|
73
|
+
- **Node package manager**: PNPM
|
|
74
|
+
- **Task orchestration**: Turborepo
|
|
75
|
+
- **Release**: Changesets
|
|
76
|
+
- **Testing**: Vitest
|
|
77
77
|
|
|
78
78
|
### Used conventions
|
|
79
79
|
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
80
|
+
- [Commits](https://www.conventionalcommits.org/)
|
|
81
|
+
- [Scripts](https://conventionalscripts.org/)
|
|
82
|
+
- [File Structure](https://nx.dev/concepts/decisions/folder-structure)
|
|
83
|
+
- Monorepo-first structure to:
|
|
84
|
+
- Keep a consistent file structure pattern across templates (ease template familiarity and onboarding).
|
|
85
|
+
- Ease examples setup.
|
|
86
|
+
- Not clutter the published package with development-related context, metadata, and artifacts.
|
|
87
87
|
|
|
88
88
|
<br>
|
|
89
89
|
|
package/configs/eslint/README.md
CHANGED
|
@@ -12,9 +12,9 @@ This package offers opinionated but extensible **[ESLint](https://eslint.org/)**
|
|
|
12
12
|
|
|
13
13
|
It allows to:
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
15
|
+
- Make collaboration across my projects effective (including onboarding with a consistent look and writing patterns).
|
|
16
|
+
- Include a minimum viable and required set of rules to foster maintainable, testable, secure, and green code over time.
|
|
17
|
+
- Accelerate development by reusing common configuration and convention defaults.
|
|
18
18
|
|
|
19
19
|
<br />
|
|
20
20
|
|
|
@@ -10,7 +10,10 @@ export const config = [
|
|
|
10
10
|
"import-x": importPlugin,
|
|
11
11
|
},
|
|
12
12
|
rules: {
|
|
13
|
-
"import-x/consistent-type-specifier-style": [
|
|
13
|
+
"import-x/consistent-type-specifier-style": [
|
|
14
|
+
"error",
|
|
15
|
+
"prefer-top-level",
|
|
16
|
+
],
|
|
14
17
|
"import-x/export": "error",
|
|
15
18
|
"import-x/first": "error",
|
|
16
19
|
"import-x/newline-after-import": "error",
|
|
@@ -15,7 +15,8 @@ export const config = [
|
|
|
15
15
|
},
|
|
16
16
|
rules: {
|
|
17
17
|
"react-hooks-extra/no-direct-set-state-in-use-effect": "error",
|
|
18
|
-
"react-hooks-extra/no-direct-set-state-in-use-layout-effect":
|
|
18
|
+
"react-hooks-extra/no-direct-set-state-in-use-layout-effect":
|
|
19
|
+
"error",
|
|
19
20
|
"react-hooks-extra/no-redundant-custom-hook": "error",
|
|
20
21
|
"react-hooks-extra/no-unnecessary-use-callback": "error",
|
|
21
22
|
"react-hooks-extra/no-unnecessary-use-memo": "error",
|
|
@@ -48,12 +48,16 @@ export const config = [
|
|
|
48
48
|
"vitest/prefer-to-have-length": "error",
|
|
49
49
|
"vitest/prefer-todo": "error",
|
|
50
50
|
"vitest/require-hook": "error",
|
|
51
|
-
"vitest/require-local-test-context-for-concurrent-snapshots":
|
|
51
|
+
"vitest/require-local-test-context-for-concurrent-snapshots":
|
|
52
|
+
"error",
|
|
52
53
|
"vitest/require-to-throw-message": "error",
|
|
53
54
|
"vitest/require-top-level-describe": "error",
|
|
54
55
|
"vitest/valid-describe-callback": "error",
|
|
55
56
|
"vitest/valid-expect": "error",
|
|
56
|
-
"vitest/valid-title": [
|
|
57
|
+
"vitest/valid-title": [
|
|
58
|
+
"error",
|
|
59
|
+
{ mustMatch: { test: ["^should "] } },
|
|
60
|
+
],
|
|
57
61
|
},
|
|
58
62
|
},
|
|
59
63
|
];
|
|
@@ -38,13 +38,19 @@ export const config = [
|
|
|
38
38
|
},
|
|
39
39
|
],
|
|
40
40
|
"@typescript-eslint/ban-tslint-comment": "error",
|
|
41
|
-
"@typescript-eslint/class-literal-property-style": [
|
|
41
|
+
"@typescript-eslint/class-literal-property-style": [
|
|
42
|
+
"error",
|
|
43
|
+
"fields",
|
|
44
|
+
],
|
|
42
45
|
"@typescript-eslint/class-methods-use-this": "error",
|
|
43
46
|
"@typescript-eslint/consistent-generic-constructors": [
|
|
44
47
|
"error",
|
|
45
48
|
"constructor",
|
|
46
49
|
],
|
|
47
|
-
"@typescript-eslint/consistent-indexed-object-style": [
|
|
50
|
+
"@typescript-eslint/consistent-indexed-object-style": [
|
|
51
|
+
"error",
|
|
52
|
+
"record",
|
|
53
|
+
],
|
|
48
54
|
"@typescript-eslint/consistent-type-assertions": [
|
|
49
55
|
"error",
|
|
50
56
|
{
|
|
@@ -105,14 +111,16 @@ export const config = [
|
|
|
105
111
|
"@typescript-eslint/no-misused-promises": "error",
|
|
106
112
|
"@typescript-eslint/no-mixed-enums": "error",
|
|
107
113
|
"@typescript-eslint/no-namespace": "error",
|
|
108
|
-
"@typescript-eslint/no-non-null-asserted-nullish-coalescing":
|
|
114
|
+
"@typescript-eslint/no-non-null-asserted-nullish-coalescing":
|
|
115
|
+
"error",
|
|
109
116
|
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
110
117
|
"@typescript-eslint/no-non-null-assertion": "error",
|
|
111
118
|
"@typescript-eslint/no-redundant-type-constituents": "error",
|
|
112
119
|
"@typescript-eslint/no-require-imports": "error",
|
|
113
120
|
"@typescript-eslint/no-shadow": "error",
|
|
114
121
|
"@typescript-eslint/no-this-alias": "error",
|
|
115
|
-
"@typescript-eslint/no-unnecessary-boolean-literal-compare":
|
|
122
|
+
"@typescript-eslint/no-unnecessary-boolean-literal-compare":
|
|
123
|
+
"error",
|
|
116
124
|
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
117
125
|
"@typescript-eslint/no-unnecessary-qualifier": "error",
|
|
118
126
|
"@typescript-eslint/no-unnecessary-template-expression": "error",
|
|
@@ -170,7 +178,8 @@ export const config = [
|
|
|
170
178
|
"@typescript-eslint/triple-slash-reference": "error",
|
|
171
179
|
"@typescript-eslint/unbound-method": "error",
|
|
172
180
|
"@typescript-eslint/unified-signatures": "error",
|
|
173
|
-
"@typescript-eslint/use-unknown-in-catch-callback-variable":
|
|
181
|
+
"@typescript-eslint/use-unknown-in-catch-callback-variable":
|
|
182
|
+
"error",
|
|
174
183
|
},
|
|
175
184
|
},
|
|
176
185
|
{
|
|
@@ -16,13 +16,27 @@ export const config = [
|
|
|
16
16
|
"sort-keys-custom-order/object-keys": [
|
|
17
17
|
"error",
|
|
18
18
|
{
|
|
19
|
-
orderedKeys: [
|
|
19
|
+
orderedKeys: [
|
|
20
|
+
"id",
|
|
21
|
+
"key",
|
|
22
|
+
"name",
|
|
23
|
+
"title",
|
|
24
|
+
"label",
|
|
25
|
+
"description",
|
|
26
|
+
],
|
|
20
27
|
},
|
|
21
28
|
],
|
|
22
29
|
"sort-keys-custom-order/type-keys": [
|
|
23
30
|
"error",
|
|
24
31
|
{
|
|
25
|
-
orderedKeys: [
|
|
32
|
+
orderedKeys: [
|
|
33
|
+
"id",
|
|
34
|
+
"key",
|
|
35
|
+
"name",
|
|
36
|
+
"title",
|
|
37
|
+
"label",
|
|
38
|
+
"description",
|
|
39
|
+
],
|
|
26
40
|
},
|
|
27
41
|
],
|
|
28
42
|
},
|
|
@@ -76,7 +76,10 @@ export const config = [
|
|
|
76
76
|
"unicorn/prefer-dom-node-remove": "error",
|
|
77
77
|
"unicorn/prefer-dom-node-text-content": "error",
|
|
78
78
|
"unicorn/prefer-event-target": "error",
|
|
79
|
-
"unicorn/prefer-export-from": [
|
|
79
|
+
"unicorn/prefer-export-from": [
|
|
80
|
+
"error",
|
|
81
|
+
{ ignoreUsedVariables: true },
|
|
82
|
+
],
|
|
80
83
|
"unicorn/prefer-global-this": "error",
|
|
81
84
|
"unicorn/prefer-includes": "error",
|
|
82
85
|
"unicorn/prefer-keyboard-event-key": "error",
|
|
@@ -12,9 +12,9 @@ This package offers opinionated but extensible **[Prettier](https://prettier.io/
|
|
|
12
12
|
|
|
13
13
|
It allows to:
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
15
|
+
- Make collaboration across my projects effective (including onboarding with a consistent look and writing patterns).
|
|
16
|
+
- Include a minimum viable and required set of rules to foster maintainable, testable, secure, and green code over time.
|
|
17
|
+
- Accelerate development by reusing common configuration and convention defaults.
|
|
18
18
|
|
|
19
19
|
<br />
|
|
20
20
|
|
|
@@ -52,8 +52,8 @@ Edit the root `package.json` file to include the following:
|
|
|
52
52
|
|
|
53
53
|
If you feel that tabbed indentation rendered on the GitHub web interface takes up too much (by default, most browsers display a tab character as 8 spaces), you can either:
|
|
54
54
|
|
|
55
|
-
-
|
|
56
|
-
-
|
|
55
|
+
- Edit your [GitHub profile appearance settings](https://docs.github.com/en/account-and-profile/setting-up-and-managing-your-personal-account-on-github/managing-user-account-settings/managing-your-tab-size-rendering-preference).
|
|
56
|
+
- Add (or update) a `.editorconfig` file at the root level to customize the tab size display on the GitHub interface.
|
|
57
57
|
|
|
58
58
|
```yaml
|
|
59
59
|
root = true
|
|
@@ -12,9 +12,9 @@ This package offers opinionated but extensible **[TypeScript](https://www.typesc
|
|
|
12
12
|
|
|
13
13
|
It allows to:
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
15
|
+
- Make collaboration across my projects effective (including onboarding with a consistent look and writing patterns).
|
|
16
|
+
- Include a minimum viable and required set of rules to foster maintainable, testable, secure, and green code over time.
|
|
17
|
+
- Accelerate development by reusing common configuration and convention defaults.
|
|
18
18
|
|
|
19
19
|
<br />
|
|
20
20
|
|
package/dist/index.js
CHANGED
|
@@ -186,7 +186,7 @@ const ESLINT_EXTENSIONS = [
|
|
|
186
186
|
"mdx"
|
|
187
187
|
];
|
|
188
188
|
|
|
189
|
-
var version = "2.
|
|
189
|
+
var version = "2.8.0";
|
|
190
190
|
|
|
191
191
|
const createWatchCommand = (program)=>{
|
|
192
192
|
program.command({
|
|
@@ -291,7 +291,6 @@ const fixLinter = eslint({
|
|
|
291
291
|
});
|
|
292
292
|
|
|
293
293
|
const PRETTIER_IGNORE_FILES = [
|
|
294
|
-
"CHANGELOG.md",
|
|
295
294
|
"pnpm-lock.yaml"
|
|
296
295
|
];
|
|
297
296
|
const fixFormatting = async (files)=>{
|
|
@@ -300,8 +299,7 @@ const fixFormatting = async (files)=>{
|
|
|
300
299
|
prettierFiles.push(`"**/!(${PRETTIER_IGNORE_FILES.join("|")})"`);
|
|
301
300
|
} else {
|
|
302
301
|
prettierFiles = files.filter((file)=>{
|
|
303
|
-
return !PRETTIER_IGNORE_FILES.some((filename)=>file.endsWith(filename))
|
|
304
|
-
file !== "README.md";
|
|
302
|
+
return !PRETTIER_IGNORE_FILES.some((filename)=>file.endsWith(filename));
|
|
305
303
|
});
|
|
306
304
|
if (prettierFiles.length === 0) return;
|
|
307
305
|
}
|
package/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
blank_issues_enabled: false
|
|
2
2
|
contact_links:
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
- name: 🤔 Questions and Help
|
|
4
|
+
about: Issues are dedicated to bugs, if you have any question, please use the dedicated GitHub discussion category.
|
|
@@ -1,61 +1,61 @@
|
|
|
1
1
|
name: Continous delivery
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
7
|
|
|
8
8
|
concurrency: ${{ github.workflow }}-${{ github.ref }}
|
|
9
9
|
|
|
10
10
|
jobs:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
11
|
+
integrate:
|
|
12
|
+
uses: ./.github/workflows/workflow.yml
|
|
13
|
+
release:
|
|
14
|
+
timeout-minutes: 5
|
|
15
|
+
needs: integrate
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
permissions:
|
|
18
|
+
contents: write
|
|
19
|
+
pull-requests: write
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
- uses: pnpm/action-setup@v4
|
|
23
|
+
- name: Get node version
|
|
24
|
+
run: echo "version=$(cat .nvmrc)" >> $GITHUB_OUTPUT
|
|
25
|
+
id: node
|
|
26
|
+
- name: Setup node ${{ steps.node.outputs.version }}
|
|
27
|
+
uses: actions/setup-node@v4
|
|
28
|
+
with:
|
|
29
|
+
node-version: ${{ steps.node.outputs.version }}
|
|
30
|
+
cache: pnpm
|
|
31
|
+
- name: Setup .npmrc
|
|
32
|
+
run: |
|
|
33
|
+
cat << EOF > "$HOME/.npmrc"
|
|
34
|
+
//registry.npmjs.org/:_authToken=$NPM_TOKEN
|
|
35
|
+
EOF
|
|
36
|
+
env:
|
|
37
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
38
|
+
- name: Install dependencies
|
|
39
|
+
run: pnpm install --frozen-lockfile
|
|
40
|
+
- name: Publish pre-release version(s)
|
|
41
|
+
if: "!contains(github.event.head_commit.message, 'chore: release package(s)')"
|
|
42
|
+
run: |
|
|
43
|
+
pnpm --filter=\!@examples/\* --recursive exec pnpm version "$(pnpm show ./ version)-next-${GITHUB_SHA::7}"
|
|
44
|
+
pnpm --filter=\!@examples/\* --recursive exec pnpm publish --tag next --no-git-checks
|
|
45
|
+
- name: Create release pull request
|
|
46
|
+
if: "!contains(github.event.head_commit.message, 'chore: release package(s)')"
|
|
47
|
+
uses: changesets/action@v1
|
|
48
|
+
with:
|
|
49
|
+
commit: "chore: release package(s)"
|
|
50
|
+
title: "chore: release package(s)"
|
|
51
|
+
env:
|
|
52
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
53
|
+
- name: Publish stable version(s)
|
|
54
|
+
if: "contains(github.event.head_commit.message, 'chore: release package(s)')"
|
|
55
|
+
uses: changesets/action@v1
|
|
56
|
+
with:
|
|
57
|
+
version: pnpm release:version
|
|
58
|
+
publish: pnpm release:publish
|
|
59
|
+
env:
|
|
60
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
61
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -1,48 +1,48 @@
|
|
|
1
1
|
name: Conventional commit
|
|
2
2
|
|
|
3
3
|
on:
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
pull_request:
|
|
5
|
+
types: [opened, edited]
|
|
6
6
|
|
|
7
7
|
jobs:
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
8
|
+
main:
|
|
9
|
+
timeout-minutes: 5
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: amannn/action-semantic-pull-request@v5
|
|
13
|
+
id: check_pr_rule
|
|
14
|
+
env:
|
|
15
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
16
|
+
with:
|
|
17
|
+
types: |
|
|
18
|
+
build
|
|
19
|
+
chore
|
|
20
|
+
ci
|
|
21
|
+
docs
|
|
22
|
+
feat
|
|
23
|
+
fix
|
|
24
|
+
perf
|
|
25
|
+
refactor
|
|
26
|
+
revert
|
|
27
|
+
style
|
|
28
|
+
test
|
|
29
|
+
requireScope: false
|
|
30
|
+
subjectPattern: ^(?![A-Z]).+$
|
|
31
|
+
subjectPatternError: The subject must start with a lowercase character
|
|
32
|
+
# Create a sticky comment to display the detailed error
|
|
33
|
+
- uses: marocchino/sticky-pull-request-comment@v2
|
|
34
|
+
if: always() && (steps.check_pr_rule.outputs.error_message != null)
|
|
35
|
+
with:
|
|
36
|
+
header: check_pr_comment
|
|
37
|
+
message: |
|
|
38
|
+
Pull request titles must follow the [Conventional Commits specification](https://www.conventionalcommits.org/).
|
|
39
|
+
Please adjust your title following:
|
|
40
|
+
```
|
|
41
|
+
${{ steps.check_pr_rule.outputs.error_message }}
|
|
42
|
+
```
|
|
43
|
+
# Delete a previous comment when the issue has been resolved
|
|
44
|
+
- if: ${{ steps.check_pr_rule.outputs.error_message == null }}
|
|
45
|
+
uses: marocchino/sticky-pull-request-comment@v2
|
|
46
|
+
with:
|
|
47
|
+
header: check_pr_comment
|
|
48
|
+
delete: true
|