Skip to content

Commit

Permalink
Merge branch 'main' into ReadMore
Browse files Browse the repository at this point in the history
  • Loading branch information
mohangolakoti authored Jun 3, 2024
2 parents c83a86e + 3e315ea commit c27a102
Show file tree
Hide file tree
Showing 38 changed files with 2,899 additions and 393 deletions.
85 changes: 47 additions & 38 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,47 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
name: "🐞 Bug Report"
description: Encountered a bug? Report it here
title: "🐞 [BUG] - <title>"
labels: ["bug"]
body:
- type: checkboxes
id: terms
attributes:
label: Issue Verification
description: Before you open an issue, please verify that it's indeed a bug and hasn't been reported before.
options:
- label: I have verified that this is a new bug report.
required: true
- label: I'm interested in working on this issue
required: true
- label: I'm part of GSSOC organization
required: true
- type: textarea
id: describe-the-bug
attributes:
label: Describe the bug
description: Please provide a clear and detailed description of the bug you've encountered.
placeholder: Describe the issue you're facing, including any error messages, unexpected behavior, and steps to reproduce.
validations:
required: false
- type: textarea
id: expected-behavior
attributes:
label: Expected behavior
description: What did you expect to happen instead of the bug you've described?
placeholder: Explain the expected outcome or behavior.
validations:
required: false
- type: textarea
id: steps-to-reproduce
attributes:
label: Steps to reproduce
description: Please provide clear, step-by-step instructions on how to reproduce the bug.
placeholder: List the exact steps you followed to encounter the bug.
validations:
required: false
- type: textarea
attributes:
label: Additional Context
description: Additional information about the bug (Optional).
validations:
required: false
67 changes: 47 additions & 20 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,47 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
name: "💡 Feature Request"
description: Got a cool idea? Suggest it here
title: "💡 [FEATURE] - <title>"
labels: ["feature"]
body:
- type: checkboxes
id: terms
attributes:
label: Idea Contribution
description: Before you open an issue, please check if a similar issue already exists or has been closed before.
options:
- label: I have read all the feature request issues.
required: true
- label: I'm interested in working on this issue
required: true
- label: I'm part of GSSOC organization
required: true
- type: textarea
id: whats-your-idea
attributes:
label: Explain feature request
description: Is your feature request related to a problem? Please describe.
placeholder: Provide a clear and concise description of the problem. For example, "I consistently encounter frustration when..."
validations:
required: false
- type: textarea
id: whats-your-solution
attributes:
label: Explain your solution
description: Could you outline the solution you envision?
placeholder: Give a clear and concise description of the desired outcome.
validations:
required: false
- type: textarea
id: alternatives
attributes:
label: Any alternative approaches/features
description: Have you considered any alternative approaches or features?
placeholder: Provide a clear and concise description of any other solutions or functionalities you've contemplated.
validations:
required: false
- type: textarea
attributes:
label: Additional Context
description: Include any extra information or visuals that may be relevant to the feature request.
validations:
required: false
2 changes: 1 addition & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Related Issue
[Cite any related issue(s) this pull request addresses. If none, simply state "None”]
Fixes #[IssueNumber]

## Description
[Please include a brief description of the changes or features added]
Expand Down
44 changes: 44 additions & 0 deletions .github/workflows/auto-comment-issue-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Auto Comment on Issue Close

on:
issues:
types: [closed]

jobs:
greet-on-close:
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Greet User
uses: actions/github-script@v5
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const issue = context.payload.issue;
// Check if the event is for an issue (not a pull request)
if (!issue.pull_request) {
const issueCreator = issue.user.login;
const issueNumber = issue.number;
const issueTitle = issue.title;
const greetingMessage = `
Hello @${issueCreator}! 🎉
Your issue **#${issueNumber} - ${issueTitle}** has been successfully closed.
We appreciate your valuable contribution and your help in improving the project. If you have any more ideas, questions, or issues, feel free to open a new issue or join the discussion in our community forum.
Stay awesome! 😊
`;
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: issueNumber,
body: greetingMessage
});
} else {
console.log('The closed issue is a pull request. No greeting message sent.');
}
35 changes: 35 additions & 0 deletions .github/workflows/auto-comment-issue-creation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Auto Comment on Issue Creation

on:
issues:
types: [opened]

permissions:
issues: write

jobs:
comment:
runs-on: ubuntu-latest

steps:
- name: Add Comment to Issue
run: |
COMMENT=$(cat <<EOF
{
"body": "Thank you for creating this issue! 🎉 @SUGAM-ARORA will look into it as soon as possible. In the meantime, please make sure to provide all the necessary details and context. If you have any questions or additional information, feel free to add them here. Your contributions are highly appreciated! 😊\n\nYou can also check our [CONTRIBUTE.md](https://github.com/SUGAM-ARORA/UniCollab/blob/main/CONTRIBUTE.md) for guidelines on contributing to this project."
}
EOF
)
RESPONSE=$(curl -s -o response.json -w "%{http_code}" \
-X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \
-d "$COMMENT")
cat response.json
if [ "$RESPONSE" -ne 201 ]; then
echo "Failed to add comment"
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/auto-comment-pr-created.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Auto Comment on PR Creation

on:
pull_request_target:
types: [opened]

permissions:
issues: write
pull-requests: write

jobs:
comment:
runs-on: ubuntu-latest

steps:
- name: Add Comment to Pull Request
run: |
COMMENT=$(cat <<EOF
{
"body": "Thank you for submitting your pull request! 🙌 We'll review it as soon as possible. In the meantime, please ensure that your changes align with our [CONTRIBUTE.md](https://github.com/SUGAM-ARORA/UniCollab/blob/main/CONTRIBUTE.md). If there are any specific instructions or feedback regarding your PR, we'll provide them here. Thanks again for your contribution! 😊"
}
EOF
)
RESPONSE=$(curl -s -o response.json -w "%{http_code}" \
-X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
-d "$COMMENT")
cat response.json
if [ "$RESPONSE" -ne 201 ]; then
echo "Failed to add comment"
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.
29 changes: 0 additions & 29 deletions .github/workflows/autocomment-iss-close.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,37 +1,37 @@
name: Close Old Issues
on:
schedule:
- cron: "0 0 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Close Old Issues
run: |
open_issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues?state=open" \
| jq -r '.[] | .number')
for issue in $open_issues; do
# Get the last updated timestamp of the issue
last_updated=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue" \
| jq -r '.updated_at')
days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 ))
if [ $days_since_update -gt 30 ]; then
curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"state":"closed"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue"
# Add a comment mentioning the repository owner
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"body\":\"@${{ github.repository_owner }} This issue has been automatically closed because it has been inactive for more than 30 days. If you believe this is still relevant, feel free to reopen it or create a new one. Thank you!\"}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue/comments"
fi
done
name: Close Old Issues
on:
schedule:
- cron: "0 0 * * *"

jobs:
close-issues:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Close Old Issues
run: |
open_issues=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues?state=open" \
| jq -r '.[] | .number')
for issue in $open_issues; do
# Get the last updated timestamp of the issue
last_updated=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue" \
| jq -r '.updated_at')
days_since_update=$(( ( $(date +%s) - $(date -d "$last_updated" +%s) ) / 86400 ))
if [ $days_since_update -gt 30 ]; then
curl -s -X PATCH -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d '{"state":"closed"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue"
# Add a comment mentioning the repository owner
curl -s -X POST -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
-d "{\"body\":\"@${{ github.repository_owner }} This issue has been automatically closed because it has been inactive for more than 30 days. If you believe this is still relevant, feel free to reopen it or create a new one. Thank you!\"}" \
"https://api.github.com/repos/${{ github.repository }}/issues/$issue/comments"
fi
done
Loading

0 comments on commit c27a102

Please sign in to comment.