Skip to content

ci(global): improved general interaction #16

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

Merged
merged 13 commits into from
Sep 26, 2024
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
3 changes: 3 additions & 0 deletions .czrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"path": "@commitlint/cz-commitlint"
}
5 changes: 1 addition & 4 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
title: '[BUG]: add your description here...'
labels: bug proposal
assignees: simonkovtyk

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

**Additional output**
If applicable, add your console log or any other output to help explain your problem.

**Additional context**
Add any other context about the problem here.
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
title: '[FEAT]: add your description here...'
labels: feature proposal
assignees: simonkovtyk

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

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

**Additional context**
Add any other context or output about the feature request here.
13 changes: 13 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
**Relates your request to an existing bug?**
*Please delete what does not apply.*
My new feature **[does/doesn't]** relate to an existing bug.
The existing bug can be found here: **[issue-link]**.

**Describe the new feature**
A clear and concise description of what you've changed.

**Explain your changes**
Give a description of what you've changed.

**Additional context**
Add any other context or output about the new feature here.
3 changes: 2 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
name: Deploy
on:
workflow_dispatch:
push:
branches:
- main
Expand All @@ -18,7 +19,7 @@ jobs:
run_install: true

- name: Build
run: tsc
run: pnpm run tsc

- name: Assets
run: |
Expand Down
27 changes: 0 additions & 27 deletions .github/workflows/pull-request.yml

This file was deleted.

49 changes: 49 additions & 0 deletions .github/workflows/pull_request-opened.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Pull request opened
on:
pull_request:
types:
- opened
branches:
- main

jobs:
notify-greet:
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Auto assign
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addAssignees({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
assignees: [ "simonkovtyk" ]
});

github.rest.issues.addLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: [ "feature" ]
});
- name: Greet
uses: actions/github-script@v7
with:
script: |
const body = `### 🎉 Welcome!

Thank you for your contribution and for opening this pull request.

### 📖 Contribution Guidelines

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.`

github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});
104 changes: 104 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Pull request checks
on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- main

jobs:
style_check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: NodeJS install
uses: actions/setup-node@v4
with:
node-version: "lts/*"

- name: pnpm install
uses: pnpm/action-setup@v4
with:
version: latest
run_install: true

- name: Lint code
run: |
pnpm run tsc --noEmit
pnpm run eslint .

- name: Lint commits
if: github.event_name == 'pull_request'
run: |
pnpm run commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose

notify_success:
runs-on: ubuntu-latest
needs: style_check
permissions:
pull-requests: write
if: success()
steps:
- name: Comment success
uses: actions/github-script@v7
with:
script: |
const body = `### ✅ Successful Review

Great news! Your pull request has been successfully reviewed, and no errors were found.

### ⏳ Next Steps

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! 🎉`

github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});

github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ["ci-success"]
});
notify_failure:
runs-on: ubuntu-latest
needs: style_check
permissions:
pull-requests: write
if: failure()
steps:
- name: Comment failure
uses: actions/github-script@v7
with:
script: |
const body = `### ⚠️ Review Required

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.

### 🛠️ Next Steps

Feel free to reach out if you have any questions or need assistance. We appreciate your effort in improving our codebase! 🙏`

github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body
});

github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ["ci-failure"]
});
1 change: 1 addition & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
npm run commitlint -- --edit $1
4 changes: 2 additions & 2 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
pnpx eslint .
tsc --noEmit
npm run tsc -- --noEmit
npm run eslint -- .
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Simon
Copyright (c) 2024 Simon Kovtyk

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
3 changes: 3 additions & 0 deletions commitlint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default {
extends: ["@commitlint/config-conventional"]
};
2 changes: 1 addition & 1 deletion docs/esbuild-favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 14 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"esbuild tsc"
],
"license": "MIT",
"version": "2.0.0-next.0",
"version": "2.0.0-next.1",
"bugs": "https://github.com/simonkovtyk/esbuild-plugin-typescript/issues",
"homepage": "https://github.com/simonkovtyk/esbuild-plugin-typescript",
"repository": {
Expand All @@ -52,6 +52,11 @@
"dependencies": {
"esbuild": ">=0.20.0"
},
"scripts": {
"commitlint": "commitlint",
"eslint": "eslint",
"tsc": "tsc"
},
"devDependencies": {
"@types/node": "^22.5.4",
"typescript": "^5.5.4",
Expand All @@ -60,9 +65,13 @@
"@stylistic/eslint-plugin": "^2.8.0",
"@eslint/js": "^9.10.0",
"@types/eslint__js": "^8.42.3",
"husky": "^9.1.6"
},
"scripts": {
"lint:husky": "husky"
"husky": "^9.1.6",
"@commitlint/cli": "^19.5.0",
"@commitlint/config-conventional": "^19.5.0",
"@commitlint/cz-commitlint": "^19.5.0",
"commitizen": "^4.3.0",
"cz-conventional-changelog": "^3.3.0",
"esbuild": ">=0.20.0",
"inquirer": "9.3.6"
}
}