Skip to content

Commit

Permalink
Release 1.1.7 (#24)
Browse files Browse the repository at this point in the history
* Enhance profanity detection with severity levels and robust matching

* PR Validation Enabled

* PR Validation Enabled
  • Loading branch information
thegdsks authored Aug 21, 2024
1 parent b7d8fa2 commit a065b59
Show file tree
Hide file tree
Showing 11 changed files with 12,609 additions and 5,303 deletions.
120 changes: 120 additions & 0 deletions .github/workflows/ci.yml
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."
43 changes: 43 additions & 0 deletions PULL_REQUEST_TEMPLATE.md
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.
Loading

0 comments on commit a065b59

Please sign in to comment.