Skip to content

Commit

Permalink
Improved manage.html vimistify#215
Browse files Browse the repository at this point in the history
  • Loading branch information
devarsheecodess committed Oct 6, 2024
2 parents ec0ac30 + 31cf09c commit 6dc24df
Show file tree
Hide file tree
Showing 25 changed files with 1,789 additions and 2,103 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/Auto_message_on_pr_close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Auto Comment on PR Close

on:
pull_request_target:
types: [closed]

permissions:
issues: write
pull-requests: write

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

steps:
- name: Add Comment to Closed PR
run: |
COMMENT=$(cat <<EOF
{
"body": "🚀 Thank you for your contribution! This pull request has been closed. If you have any questions or need further assistance, 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.pull_request.number }}/comments \
-d "$COMMENT")
cat response.json
if [ "$RESPONSE" -ne 201 ]; then
echo "Failed to add comment on PR close"
exit 1
fi
56 changes: 56 additions & 0 deletions .github/workflows/Auto_message_on_pr_open.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Auto Comment on PR Open

on:
pull_request_target:
types: [opened]

permissions:
issues: write
pull-requests: write

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

steps:
- name: Add Comment to Opened PR
run: |
COMMENT=$(cat <<EOF
{
"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! \n\nFeel free to join our community on [Discord](https://discord.gg/9mZnkTRFFe) to discuss more!"
}
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 PR open"
exit 1
fi
- name: Add Reviewer to Pull Request
run: |
REVIEWERS=$(cat <<EOF
{
"reviewers": ["mansiruhil13"]
}
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 }}/pulls/${{ github.event.pull_request.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 }}
35 changes: 35 additions & 0 deletions .github/workflows/auto-comment-on-issue-close.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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 raise them, and we can discuss more!"
}
EOF
)
RESPONSE=$(curl -s -o response.json -w "%{http_code}" \
-X POST \
-H "Authorization: token $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
fi
36 changes: 36 additions & 0 deletions .github/workflows/auto-comment-on-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Loading

0 comments on commit 6dc24df

Please sign in to comment.