-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #18 from simonkovtyk/ci/linter [skip ci]
ci(workflows): added linter configuration
- Loading branch information
Showing
12 changed files
with
199 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"path": "@commitlint/cz-commitlint" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-file-copy/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 | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
npm run commitlint -- --edit $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
npm run tsc -- --noEmit | ||
npm run eslint -- . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default { | ||
extends: ["@commitlint/config-conventional"] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters