Skip to content

Commit d84ac19

Browse files
committed
ci(global): improved general interaction
1 parent 8d549fc commit d84ac19

File tree

14 files changed

+185
-42
lines changed

14 files changed

+185
-42
lines changed

.czrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"path": "@commitlint/cz-commitlint"
3+
}

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Bug report
33
about: Create a report to help us improve
4-
title: ''
4+
title: '[BUG]: add your description here...'
55
labels: bug proposal
66
assignees: simonkovtyk
77

@@ -23,8 +23,5 @@ A clear and concise description about how to trigger the bug again.
2323
**Expected behavior**
2424
A clear and concise description of what you expected to happen.
2525

26-
**Additional output**
27-
If applicable, add your console log or any other output to help explain your problem.
28-
2926
**Additional context**
3027
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
name: Feature request
33
about: Suggest an idea for this project
4-
title: ''
4+
title: '[FEAT]: add your description here...'
55
labels: feature proposal
66
assignees: simonkovtyk
77

@@ -13,7 +13,7 @@ My request **[does/doesn't]** relate to an existing bug.
1313
The existing bug can be found here: **[issue-link]**.
1414

1515
**Describe your request**
16-
A clear and concise description of what you want to request or offer by Pull Request.
16+
A clear and concise description of what you want to request.
1717

1818
**Additional context**
1919
Add any other context or output about the feature request here.

.github/pull_request_template.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
**Relates your request to an existing bug?**
2+
*Please delete what does not apply.*
3+
My new feature **[does/doesn't]** relate to an existing bug.
4+
The existing bug can be found here: **[issue-link]**.
5+
6+
**Describe the new feature**
7+
A clear and concise description of what you've changed.
8+
9+
**Explain your changes**
10+
Give a description of what you've changed.
11+
12+
**Additional context**
13+
Add any other context or output about the new feature here.

.github/workflows/deploy.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
name: Deploy
22
on:
3+
workflow_dispatch:
34
push:
45
branches:
56
- main

.github/workflows/pull-request.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Pull request opened
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
branches:
8+
- main
9+
10+
jobs:
11+
notify-greet:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Auto assign
15+
uses: actions/github-script@v7
16+
with:
17+
script: |
18+
github.rest.issues.addAssignees({
19+
issue_number: context.issue.number,
20+
owner: context.repo.owner,
21+
repo: context.repo.repo,
22+
assignees: [ "simonkovtyk" ]
23+
});
24+
25+
github.rest.issues.addLabels({
26+
issue_number: context.issue.number,
27+
owner: context.repo.owner,
28+
repo: context.repo.repo,
29+
labels: [ "feature" ]
30+
});
31+
- name: Greet
32+
uses: actions/github-script@v7
33+
with:
34+
script: |
35+
const body = `### 🎉 Welcome!
36+
37+
Thank you for your contribution and for opening this pull request.
38+
39+
### 📖 Contribution Guidelines
40+
41+
For more details on how to contribute effectively, please refer to our [How to Contribute](https://github.com/simonkovtyk/esbuild-plugin-cleanup/blob/main/docs/guides/HOW_TO_CONTRIBUTE.md) document.`
42+
43+
github.rest.issues.createComment({
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
issue_number: context.issue.number,
47+
body
48+
});

.github/workflows/pull_request.yml

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
name: Pull request checks
2+
on:
3+
pull_request:
4+
types:
5+
- opened
6+
- reopened
7+
- synchronize
8+
branches:
9+
- main
10+
11+
jobs:
12+
style_check:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
- name: Install
19+
uses: pnpm/action-setup@v4
20+
with:
21+
version: latest
22+
run_install: true
23+
24+
- name: Lint code
25+
run: |
26+
pnpm run lint:tsc
27+
pnpm run lint:eslint
28+
29+
- name: Lint commits
30+
if: github.event_name == 'pull_request'
31+
run: |
32+
commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose
33+
34+
notify_success:
35+
runs-on: ubuntu-latest
36+
needs: style_check
37+
38+
if: success()
39+
steps:
40+
- name: Comment success
41+
uses: actions/github-script@v7
42+
with:
43+
script: |
44+
const body = `### ✅ Successful Review
45+
46+
Great news! Your pull request has been successfully reviewed, and no errors were found.
47+
48+
### ⏳ Next Steps
49+
50+
The author will review the changes shortly, and we look forward to merging your contributions into the project. Thank you for your hard work and dedication! 🎉`
51+
52+
github.rest.issues.createComment({
53+
owner: context.repo.owner,
54+
repo: context.repo.repo,
55+
issue_number: context.issue.number,
56+
body
57+
});
58+
59+
github.rest.issues.addLabels({
60+
owner: context.repo.owner,
61+
repo: context.repo.repo,
62+
issue_number: context.issue.number,
63+
labels: ["ci-success"]
64+
});
65+
notify_failure:
66+
runs-on: ubuntu-latest
67+
needs: style_check
68+
if: failure()
69+
steps:
70+
- name: Comment failure
71+
uses: actions/github-script@v7
72+
with:
73+
script: |
74+
const body = `### ⚠️ Review Required
75+
76+
Thank you for your contribution! Upon review, we've identified some issues in the pull request that need to be addressed. Please take a moment to review the errors and make the necessary adjustments before we can proceed with the integration.
77+
78+
### 🛠️ Next Steps
79+
80+
Feel free to reach out if you have any questions or need assistance. We appreciate your effort in improving our codebase! 🙏`
81+
82+
github.rest.issues.createComment({
83+
owner: context.repo.owner,
84+
repo: context.repo.repo,
85+
issue_number: context.issue.number,
86+
body
87+
});
88+
89+
github.rest.issues.addLabels({
90+
owner: context.repo.owner,
91+
repo: context.repo.repo,
92+
issue_number: context.issue.number,
93+
labels: ["ci-failure"]
94+
});

.husky/commit-msg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npm run lint:commit $1

.husky/pre-commit

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
pnpx eslint .
2-
tsc --noEmit
1+
npm run lint:tsc
2+
npm run lint:eslint

0 commit comments

Comments
 (0)