-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enhance profanity detection with severity levels and robust matching * PR Validation Enabled * PR Validation Enabled
- Loading branch information
Showing
11 changed files
with
12,609 additions
and
5,303 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,120 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, synchronize] | ||
push: | ||
branches: | ||
- main | ||
- 'release/*' | ||
- 'develop/*' | ||
- 'feature/*' | ||
|
||
jobs: | ||
lint: | ||
name: Lint Codebase | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run ESLint | ||
run: npm run lint | ||
|
||
test: | ||
name: Run Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [14, 16, 18] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Cache Node.js modules | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.npm | ||
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} | ||
restore-keys: | | ||
${{ runner.os }}-node- | ||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run Tests | ||
run: npm test | ||
|
||
security: | ||
name: Security Scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run npm audit | ||
run: npm audit --audit-level=moderate | ||
|
||
pr-template-check: | ||
name: Validate PR Template Compliance | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Fetch PR Description | ||
id: pr | ||
run: echo "PR_BODY=$(gh pr view ${{ github.event.pull_request.number }} --json body --jq '.body')" >> $GITHUB_ENV | ||
|
||
- name: Fetch PR Template | ||
id: pr_template | ||
run: | | ||
TEMPLATE_PATH=$(find .github -name "PULL_REQUEST_TEMPLATE.md") | ||
echo "PR_TEMPLATE=$(cat $TEMPLATE_PATH)" >> $GITHUB_ENV | ||
- name: Compare PR Description with Template | ||
run: | | ||
if [[ "${{ env.PR_BODY }}" == "${{ env.PR_TEMPLATE }}" ]]; then | ||
echo "PR description is too similar to the template. Please provide more detailed information." | ||
exit 1 | ||
else | ||
echo "PR description differs from the template." | ||
fi | ||
- name: Fail if PR description is empty | ||
run: | | ||
if [[ -z "${{ env.PR_BODY }}" ]]; then | ||
echo "PR description is empty. Please provide a detailed description." | ||
exit 1 | ||
fi | ||
- name: Check if PR is ready for review | ||
run: | | ||
if [[ "${{ github.event.pull_request.draft }}" == "true" ]]; then | ||
echo "PR is still a draft. Please mark it as ready for review when done." | ||
exit 1 | ||
fi | ||
- name: Complete PR template check | ||
run: echo "PR template compliance check completed successfully." |
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,43 @@ | ||
## Pull Request Title | ||
|
||
### Description | ||
|
||
Please include a summary of the changes and the related issue(s) (if any). Highlight the main features, bug fixes, or improvements introduced by this PR. | ||
|
||
- **What has changed?** | ||
- [ ] New feature | ||
- [ ] Bug fix | ||
- [ ] Documentation update | ||
- [ ] Other (describe) | ||
|
||
### Related Issue(s) | ||
|
||
Please link the related issue(s) that this pull request addresses. | ||
|
||
Fixes # (issue) | ||
|
||
### Changes Checklist | ||
|
||
Please ensure your PR meets the following criteria: | ||
|
||
- [ ] My code follows the style guidelines of this project. | ||
- [ ] I have performed a self-review of my code. | ||
- [ ] I have commented on my code, particularly in hard-to-understand areas. | ||
- [ ] I have added tests that prove my fix is effective or that my feature works. | ||
- [ ] New and existing unit tests pass locally with my changes. | ||
- [ ] I have updated the documentation (if applicable). | ||
|
||
### How Has This Been Tested? | ||
|
||
Please describe the tests that you ran to verify your changes. Provide instructions to reproduce the testing scenarios if necessary. | ||
|
||
- [ ] Test A | ||
- [ ] Test B | ||
|
||
### Screenshots (if applicable) | ||
|
||
If your changes involve visual updates, please add screenshots to help explain your work. | ||
|
||
### Additional Comments | ||
|
||
Add any additional information or context that might be important for the reviewer to know about your pull request. |
Oops, something went wrong.