Skip to content

Commit

Permalink
.github files:
Browse files Browse the repository at this point in the history
;
  • Loading branch information
UTSAVS26 committed Sep 28, 2024
1 parent 0454b7a commit c756f43
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 25 deletions.
39 changes: 19 additions & 20 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,25 @@
Closes: <!-- #issue number -->
# Pull Request for DL-Simplified 💡

- **Title** :

## Issue Title : <!-- Enter the issue title here -->

- **Info about the related issue (Aim of the project)** : <!-- What's the goal of the project -->
- **Name:** <!--Mention Your name-->
- **Idenitfy yourself:** <!-- Mention your role (like GSOC, GSSOC, SSOC, etc. Contributor) -->
- **GitHub ID:** <!-- Mention your GitHub ID -->
- **Email ID:** <!--Mention your email ID for further communication. -->
- **Idenitfy yourself: (Mention in which program you are contributing in. Eg. For a WoB 2024 participant it's, `WoB Participant`)** <!-- Mention in which program you are contributing -->


<!-- Mention the following details and these are mandatory -->

Closes: #issue number that will be closed through this PR

### Describe the add-ons or changes you've made 📃

Give a clear description of what have you added or modifications made

## Type of change ☑️

### Type of change ☑️
<!-- Please delete options that are not relevant. -->
What sort of change have you made:
<!--
Example how to mark a checkbox:-
Expand All @@ -25,27 +31,20 @@ Example how to mark a checkbox:-
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

### How Has This Been Tested? ⚙️
<!-- Describe how it has been tested
Describe how have you verified the changes made -->

## How Has This Been Tested? ⚙️

Describe how it has been tested
Describe how have you verified the changes made

### Checklist: ☑️
## Checklist: ☑️
<!--
Example how to mark a checkbox:-
- [x] My code follows the code style of this project.
-->
- [ ] My code follows the [Contributing Guidelines](https://github.com/Avdhesh-Varshney/AI-Code/blob/main/README.md) & [Code of Conduct](https://github.com/Avdhesh-Varshney/AI-Code/blob/main/CODE_OF_CONDUCT.md) of this project.
- [ ] This PR does not contain plagiarized content.
- [ ] My code follows the guidelines of this project.
- [ ] I have performed a self-review of my own code.
- [ ] I have commented my code, particularly wherever it was hard to understand.
- [ ] I have made corresponding changes to the documentation.
- [ ] My changes generate no new warnings.


### Screenshots 📷
<!-- Must add the screenshot of the project or your changes for review your pr -->


### Note to reviewers 📄
<!-- Add notes to reviewers if applicable -->
- [ ] I have added things that prove my fix is effective or that my feature works.
- [ ] Any dependent changes have been merged and published in downstream modules.
37 changes: 37 additions & 0 deletions .github/workflows/Auto_message_on_pr_merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Auto Comment on PR Merge

on:
pull_request:
types: [closed]

permissions:
issues: write
pull-requests: write

jobs:
comment-on-merge:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:
- name: Add Comment to Merged PR
run: |
COMMENT=$(cat <<EOF
{
"body": "🎉 Congratulations! Your pull request has been successfully merged! Thank you for your valuable contribution to our project. We appreciate your efforts!"
}
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 on merge"
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Auto Comment and Add Reviewer on PR
name: Auto Comment on PR Open

on:
pull_request_target:
Expand All @@ -9,15 +9,15 @@ permissions:
pull-requests: write

jobs:
comment-and-review:
comment-on-open:
runs-on: ubuntu-latest

steps:
- name: Add Comment to Pull Request
- name: Add Comment to Opened PR
run: |
COMMENT=$(cat <<EOF
{
"body": "Thank you for submitting your pull request! We'll review it as soon as possible."
"body": "👋 Thank you for opening this pull request! We're excited to review your contribution. Please give us a moment, and we'll get back to you shortly!"
}
EOF
)
Expand All @@ -29,9 +29,10 @@ jobs:
-d "$COMMENT")
cat response.json
if [ "$RESPONSE" -ne 201 ]; then
echo "Failed to add comment"
echo "Failed to add comment on PR open"
exit 1
fi
- name: Add Reviewer to Pull Request
run: |
REVIEWERS=$(cat <<EOF
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/auto-comment-on-issue-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Auto Comment on Issue Close

on:
issues:
types: [closed]

permissions:
issues: write

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

steps:
- name: Add Comment to Closed Issue
run: |
COMMENT=$(cat <<EOF
{
"body": "✅ This issue has been closed. Thank you for your contribution! If you have any further questions or issues, feel free to reach out!"
}
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 on issue close"
exit 1
f1
55 changes: 55 additions & 0 deletions .github/workflows/auto-comment-on-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Auto Comment on Issue Open

on:
issues:
types: [opened]

permissions:
issues: write

jobs:
comment-on-issue:
runs-on: ubuntu-latest

steps:
- name: Add Comment to Opened Issue
run: |
COMMENT=$(cat <<EOF
{
"body": "🙌 Thank you for bringing this issue to our attention! We appreciate your input and will investigate it as soon as possible."
}
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 on issue open"
exit 1
fi
- name: Add Reviewer to Issue
run: |
REVIEWERS=$(cat <<EOF
{
"reviewers": ["UTSAVS26"]
}
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 }}/requested_reviewers \
-d "$REVIEWERS")
cat response.json
if [ "$RESPONSE" -ne 201 ]; then
echo "Failed to add reviewer"
exit 1
fi
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c756f43

Please sign in to comment.