Skip to content

Commit 12838cb

Browse files
adding workflows for the repository
1 parent 5032406 commit 12838cb

File tree

4 files changed

+75
-1
lines changed

4 files changed

+75
-1
lines changed

.github/workflows/commitlint.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Lint Commit Messages
2+
on: [pull_request]
3+
4+
permissions:
5+
contents: read
6+
pull-requests: read
7+
8+
jobs:
9+
commitlint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
- uses: wagoid/commitlint-github-action@v6

.github/workflows/semantic-pr.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: "Semantic pull requests"
2+
3+
on: pull_request
4+
5+
jobs:
6+
main:
7+
name: Validate PR title
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: amannn/action-semantic-pull-request@v4
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
with:
14+
types: |
15+
fix
16+
feat
17+
chore
18+
refactor
19+
exp
20+
doc
21+
test
22+
requireScope: false
23+
subjectPattern: ^(?![A-Z]).+$
24+
subjectPatternError: |
25+
The subject "{subject}" found in the pull request title "{title}"
26+
didn't match the configured pattern. Please ensure that the subject
27+
doesn't start with an uppercase character.
28+
# For work-in-progress PRs you can typically use draft pull requests
29+
# from GitHub. However, private repositories on the free plan don't have
30+
# this option and therefore this action allows you to opt-in to using the
31+
# special "[WIP]" prefix to indicate this state. This will avoid the
32+
# validation of the PR title and the pull request checks remain pending.
33+
# Note that a second check will be reported if this is enabled.
34+
wip: true
35+
# When using "Squash and merge" on a PR with only one commit, GitHub
36+
# will suggest using that commit message instead of the PR title for the
37+
# merge commit, and it's easy to commit this by mistake. Enable this option
38+
# to also validate the commit message for one commit PRs.
39+
validateSingleCommit: true
40+
# Related to `validateSingleCommit` you can opt-in to validate that the PR
41+
# title matches a single commit to avoid confusion.
42+
validateSingleCommitMatchesPrTitle: true
43+
# If the PR contains one of these labels, the validation is skipped.
44+
# Multiple labels can be separated by newlines.
45+
# If you want to rerun the validation when labels change, you might want
46+
# to use the `labeled` and `unlabeled` event triggers in your workflow.
47+
ignoreLabels: |
48+
bot
49+
dependencies

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
node_modules/
22
package-lock.json
3-
.env
3+
.env
4+
coverage/
5+
test-outputs/

commitlint.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
module.exports = {
2+
extends: ["@commitlint/config-conventional"],
3+
rules: {
4+
"type-enum": () => [
5+
2,
6+
"always",
7+
["fix", "feat", "chore", "refactor", "docs", "test"],
8+
],
9+
},
10+
};

0 commit comments

Comments
 (0)