Skip to content

Commit 1a407fd

Browse files
authored
Merge branch 'main' into sortcolor
2 parents 5d9ee83 + 72494bf commit 1a407fd

File tree

233 files changed

+22710
-861
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

233 files changed

+22710
-861
lines changed

.github/ISSUE_TEMPLATE/documentation.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ body:
1111
options:
1212
- label: I have searched the existing issues
1313
required: true
14+
1415
- type: textarea
1516
id: issue-description
1617
attributes:
@@ -19,6 +20,7 @@ body:
1920
placeholder: Describe the improvement or correction you'd like to see in the documentation.
2021
validations:
2122
required: true
23+
2224
- type: textarea
2325
id: suggested-change
2426
attributes:
@@ -27,14 +29,16 @@ body:
2729
placeholder: Explain how the documentation should be updated or corrected.
2830
validations:
2931
required: true
32+
3033
- type: textarea
3134
id: rationale
3235
attributes:
3336
label: Rationale
3437
description: Why is this documentation update necessary or beneficial?
3538
placeholder: Explain the importance or reasoning behind the suggested change.
3639
validations:
37-
required: False
40+
required: false
41+
3842
- type: dropdown
3943
id: urgency
4044
attributes:
@@ -47,14 +51,34 @@ body:
4751
default: 0
4852
validations:
4953
required: true
54+
5055
- type: checkboxes
5156
id: terms
5257
attributes:
53-
label: Record
58+
label: Acknowledgements
59+
description: Ensure you have read and agree to the project's guidelines.
5460
options:
55-
- label: "I have read the Contributing Guidelines"
61+
- label: I have read the Contributing Guidelines
5662
required: true
57-
- label: "I'm a GSSOC'24 contributor"
63+
- label: I'm a GSSOC'24 contributor
5864
required: false
59-
- label: "I have starred the repository"
65+
- label: I have starred the repository
66+
required: true
67+
- label: I have read and followed the Contribution Guidelines
68+
required: true
69+
- label: I have followed the code style guidelines of this project
70+
required: true
71+
- label: I have checked for any existing open issues that my pull request may address
72+
required: true
73+
- label: I have ensured that my changes do not break any existing functionality
74+
required: true
75+
- label: Each contributor is allowed to create a maximum of 4 issues per day. This helps us manage and address issues efficiently
76+
required: true
77+
- label: I have read the resources for guidance listed below
78+
required: true
79+
- label: I have not used AI-generated content (e.g., ChatGPT, other AI tools)
80+
required: true
81+
- label: I have not used content from existing sites (e.g., text, images)
82+
required: true
83+
- label: I have followed all security rules and only shared trusted resources
6084
required: true

.github/pull_request_template.md

Lines changed: 51 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [ ] Bug fix
1212
- [ ] Feature enhancement
1313
- [ ] Documentation update
14+
- [ ] Security enhancement
1415
- [ ] Other (specify): _______________
1516

1617
## Screenshots / Videos (if applicable)
@@ -23,24 +24,63 @@
2324
- [ ] I have tested the changes thoroughly before submitting this pull request.
2425
- [ ] I have provided relevant issue numbers, screenshots, and videos after making the changes.
2526
- [ ] I have commented my code, particularly in hard-to-understand areas.
26-
<!-- [X] - put a cross/X inside [] to check the box -->
27+
- [ ] I have followed the code style guidelines of this project.
28+
- [ ] I have checked for any existing open issues that my pull request may address.
29+
- [ ] I have ensured that my changes do not break any existing functionality.
30+
- [ ] Each contributor is allowed to create a maximum of 4 issues per day. This helps us manage and address issues efficiently.
31+
- [ ] I have read the resources for guidance listed below.
32+
- [ ] I have followed security best practices in my code changes.
2733

2834
## Additional Context
2935

3036
[Include any additional information or context that might be helpful for reviewers.]
3137

3238
## Resources for Guidance
3339

34-
Here are some resources that may be helpful as you contribute to CodeHarborHub:
35-
- [Code Harbor Hub Community Features](https://www.codeharborhub.live/community/features)
36-
- [Docusaurus Documentation](https://docusaurus.io/docs/create-doc)
37-
- [React.js Documentation](https://legacy.reactjs.org/docs/getting-started.html)
38-
- [Markdown Guide](https://www.markdownguide.org/)
39-
- [MDX Documentation](https://mdxjs.com/docs/)
40-
- [Mermaid Documentation](https://mermaid.js.org/)
40+
Please read the following resources before submitting your contribution:
41+
42+
- [ ] [Code Harbor Hub Community Features](https://www.codeharborhub.live/community/features)
43+
- [ ] [Docusaurus Documentation](https://docusaurus.io/docs/create-doc)
44+
- [ ] [React.js Documentation](https://legacy.reactjs.org/docs/getting-started.html)
45+
- [ ] [Markdown Guide](https://www.markdownguide.org/)
46+
- [ ] [MDX Documentation](https://mdxjs.com/docs/)
47+
- [ ] [Mermaid Documentation](https://mermaid.js.org/)
4148

4249
**Resources for DSA Features on Our Site:**
4350

44-
- Tabs: [Switch Languages](https://www.codeharborhub.live/community/features#multi-language-support-code-blocks)
45-
- [Line Numbering](https://www.codeharborhub.live/community/features#line-numbering)
46-
- [Math Equations](https://www.codeharborhub.live/community/features#math-equations-with-katex)
51+
- [ ] [Tabs: Switch Languages](https://www.codeharborhub.live/community/features#multi-language-support-code-blocks)
52+
- [ ] [Line Numbering](https://www.codeharborhub.live/community/features#line-numbering)
53+
- [ ] [Math Equations](https://www.codeharborhub.live/community/features#math-equations-with-katex)
54+
55+
## Contribution Guidelines
56+
57+
Thank you for considering contributing to our project! To ensure smooth collaboration and effective contribution management, please adhere to the following guidelines:
58+
59+
### Issue Creation
60+
61+
1. **Limit on Issues:**
62+
- Each contributor is allowed to create a maximum of **4 issues per day**. This helps us manage and address issues efficiently.
63+
64+
### Contribution Levels
65+
66+
2. **Basic Contributions:**
67+
- This project is primarily focused on documentation. Most of the setup has been completed, so contributors will generally need to work on basic code tasks, such as writing tests.
68+
- For these tasks, issues will be assigned the **level1** label.
69+
70+
3. **Acknowledging Hard Work:**
71+
- If a contributor puts in significant effort on a task, the issue will be upgraded to **level2**. This is our way of recognizing and appreciating extra effort.
72+
73+
4. **Feature Additions and Component Work:**
74+
- Contributors working on new features or components using JSX/TSX will be assigned a level based on the complexity and quality of their work.
75+
- The more complex and valuable the contribution, the higher the level assigned.
76+
77+
### Level Definitions
78+
79+
- **Level1:**
80+
- Tasks are straightforward, such as fixing minor bugs, writing tests, or making simple documentation updates.
81+
- **Level2:**
82+
- Tasks require more effort, such as addressing complex bugs, improving existing features, or making substantial documentation improvements.
83+
- **Level3:**
84+
- Tasks are highly complex and involve significant new feature development, major refactoring, or extensive contributions to the project’s core components.
85+
86+
We look forward to your contributions and appreciate your effort in helping us improve the project!

.github/workflows/greetings.yml

Lines changed: 49 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,61 @@
1-
name: Greetings
1+
name: 'Greetings'
22

3-
on: [pull_request_target, issues]
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request_target:
7+
types: [opened]
8+
9+
permissions:
10+
issues: write
11+
pull-requests: write
412

513
jobs:
6-
greeting:
14+
welcome:
715
runs-on: ubuntu-latest
8-
permissions:
9-
issues: write
10-
pull-requests: write
16+
1117
steps:
18+
- name: Check out repository
19+
uses: actions/checkout@v4
20+
1221
- name: Greet first-time contributors
1322
id: greet
1423
uses: actions/first-interaction@v1
1524
with:
1625
repo-token: ${{ secrets.GITHUB_TOKEN }}
1726
issue-message: |
18-
Hi there! 👋 Thank you for opening your first issue on CodeHarborHub. We're excited to hear your thoughts and help you out. Please provide as much detail as you can so we can assist you effectively.
27+
Hi there! 👋 Thank you for opening your issue on CodeHarborHub. We're excited to hear your thoughts and help you out. You've raised a great topic! Please provide as much detail as you can so we can assist you effectively. Welcome aboard!
1928
pr-message: |
20-
Hi there! 👋 Thank you for submitting your first pull request to CodeHarborHub. We appreciate your contribution! Our team will review it soon. If you have any questions or need further assistance, feel free to reach out.
29+
Hi there! 👋 Thank you for submitting your pull request to CodeHarborHub. Great job on the contribution! 🎉 We appreciate your efforts and our team will review it soon. If you have any questions or need further assistance, feel free to reach out. Keep up the great work!
30+
31+
- name: Assign issue or pull request to team member
32+
if: github.event_name == 'issues' || github.event_name == 'pull_request_target'
33+
run: |
34+
ISSUE_NUMBER=${{ github.event.issue.number || github.event.pull_request.number }}
35+
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
36+
-d '{"assignees":["team-member"]}' \
37+
"https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}"
38+
39+
- name: Welcome message for community contributors
40+
if: github.event_name == 'issues' || github.event_name == 'pull_request_target'
41+
uses: EddieHubCommunity/gh-action-community/src/welcome@main
42+
with:
43+
github-token: ${{ secrets.GITHUB_TOKEN }}
44+
issue-message: "Hi @${{ github.actor }}! Thanks for opening this issue. We appreciate your contribution to this open-source project. Your input is valuable and we aim to respond or assign your issue as soon as possible. Thanks again!"
45+
pr-message: "Great job, @${{ github.actor }}! 🎉 Thank you for submitting your pull request to CodeHarborHub. We appreciate your contribution and enthusiasm! Our team will review it soon. If you have any questions or need further assistance, feel free to reach out. Thanks for contributing!"
46+
47+
- name: Label first-time issues
48+
if: github.event_name == 'issues'
49+
run: |
50+
ISSUE_NUMBER=${{ github.event.issue.number }}
51+
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
52+
-d '{"labels":["CodeHarborHub - Thanks for creating an issue!"]}' \
53+
"https://api.github.com/repos/${{ github.repository }}/issues/${ISSUE_NUMBER}"
54+
55+
- name: Label first-time pull requests
56+
if: github.event_name == 'pull_request_target'
57+
run: |
58+
PR_NUMBER=${{ github.event.pull_request.number }}
59+
curl -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
60+
-d '{"labels":["CodeHarborHub - Thanks for creating a pull request!"]}' \
61+
"https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}"

.github/workflows/issue_creation_workflow.yml

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
types: [opened]
66

77
jobs:
8-
check-contributor-issues:
8+
check-issue:
99
runs-on: ubuntu-latest
1010

1111
steps:
@@ -17,24 +17,33 @@ jobs:
1717
with:
1818
node-version: '14'
1919

20-
- name: Retrieve Contributors
20+
- name: Retrieve Contributor's Open Issues
21+
id: retrieve-issues
2122
run: |
22-
CONTRIBUTORS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/contributors | jq -r '.[].login')
23-
echo "::set-output name=contributors::$CONTRIBUTORS"
24-
25-
- name: Count Open Issues for Each Contributor
26-
id: count-issues
27-
run: |
28-
for contributor in ${{ steps.retrieve-contributors.outputs.contributors }}; do
29-
ISSUE_COUNT=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/search/issues?q=is:open+author:${contributor}+repo:${{ github.repository }}" | jq -r '.total_count')
30-
echo "::set-output name=${contributor}_issue_count::$ISSUE_COUNT"
31-
done
23+
ISSUE_COUNT=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/search/issues?q=is:open+author:${{ github.event.issue.user.login }}+repo:${{ github.repository }}" | jq -r '.total_count')
24+
echo "::set-output name=issue_count::$ISSUE_COUNT"
3225
3326
- name: Check Contributor's Open Issues Count
3427
run: |
35-
contributor=${{ github.event.issue.user.login }}
36-
issue_count=${{ steps.count-issues.outputs["${contributor}_issue_count"] }}
28+
issue_count=${{ steps.retrieve-issues.outputs.issue_count }}
3729
if [ "$issue_count" -ge 4 ]; then
38-
echo "Contributor $contributor has $issue_count open issues. Please complete your existing open issues before creating a new one."
30+
echo "Contributor ${{ github.event.issue.user.login }} has $issue_count open issues. Please complete your existing open issues before creating a new one."
31+
exit 1
32+
fi
33+
34+
- name: Validate Issue Content
35+
id: validate-issue
36+
run: |
37+
issue_body="${{ github.event.issue.body }}"
38+
if [[ "$issue_body" == *"AI-generated content"* ]] || [[ "$issue_body" == *"existing sites"* ]]; then
39+
echo "Issue body contains disallowed content."
40+
exit 1
41+
fi
42+
43+
- name: Check for Security and Trust
44+
run: |
45+
issue_body="${{ github.event.issue.body }}"
46+
if [[ "$issue_body" != *"security"* ]] || [[ "$issue_body" != *"trust"* ]]; then
47+
echo "Issue does not mention security or trust."
3948
exit 1
4049
fi
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: PR Creation Workflow
2+
3+
on:
4+
pull_request:
5+
types: [opened, edited]
6+
7+
jobs:
8+
check-pr:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Set up Node.js
16+
uses: actions/setup-node@v4
17+
with:
18+
node-version: '14'
19+
20+
- name: Validate PR Description
21+
id: validate-pr
22+
run: |
23+
pr_body="${{ github.event.pull_request.body }}"
24+
required_checkboxes=(
25+
"I have performed a self-review of my code."
26+
"I have read and followed the Contribution Guidelines."
27+
"I have tested the changes thoroughly before submitting this pull request."
28+
"I have provided relevant issue numbers, screenshots, and videos after making the changes."
29+
"I have commented my code, particularly in hard-to-understand areas."
30+
"I have followed the code style guidelines of this project."
31+
"I have checked for any existing open issues that my pull request may address."
32+
"I have ensured that my changes do not break any existing functionality."
33+
"Each contributor is allowed to create a maximum of 4 issues per day. This helps us manage and address issues efficiently."
34+
"I have read the resources for guidance listed below."
35+
"I have not used AI-generated content (e.g., ChatGPT, other AI tools)."
36+
"I have not used content from existing sites (e.g., text, images)."
37+
"I have followed all security rules and only shared trusted resources."
38+
)
39+
for checkbox in "${required_checkboxes[@]}"; do
40+
if [[ "$pr_body" != *"$checkbox"* ]]; then
41+
echo "Missing required checkbox: $checkbox"
42+
exit 1
43+
fi
44+
done
45+
46+
- name: Retrieve Contributors
47+
run: |
48+
CONTRIBUTORS=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/repos/${{ github.repository }}/contributors | jq -r '.[].login')
49+
echo "::set-output name=contributors::$CONTRIBUTORS"
50+
51+
- name: Count Open Issues for Each Contributor
52+
id: count-issues
53+
run: |
54+
for contributor in ${{ steps.retrieve-contributors.outputs.contributors }}; do
55+
ISSUE_COUNT=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" "https://api.github.com/search/issues?q=is:open+author:${contributor}+repo:${{ github.repository }}" | jq -r '.total_count')
56+
echo "::set-output name=${contributor}_issue_count::$ISSUE_COUNT"
57+
done
58+
59+
- name: Check Contributor's Open Issues Count
60+
run: |
61+
contributor=${{ github.event.pull_request.user.login }}
62+
issue_count=${{ steps.count-issues.outputs["${contributor}_issue_count"] }}
63+
if [ "$issue_count" -ge 4 ]; then
64+
echo "Contributor $contributor has $issue_count open issues. Please complete your existing open issues before creating a new one."
65+
exit 1
66+
fi

0 commit comments

Comments
 (0)