Skip to content

Commit 2be5b90

Browse files
authored
Added Auto-Comment Workflow for Pull Requests and Issues (#12)
* Update README.md * Update auto-comment workflow for PRs and Issues
1 parent 10f96f5 commit 2be5b90

File tree

1 file changed

+55
-14
lines changed

1 file changed

+55
-14
lines changed

Diff for: .github/workflows/autoComment.yaml

+55-14
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
issues:
55
types: [opened]
66
pull_request:
7-
types: [opened]
7+
types:
8+
- opened
89

910
jobs:
1011
auto-comment:
@@ -13,17 +14,57 @@ jobs:
1314
issues: write
1415
pull-requests: write
1516
steps:
16-
- name: Auto Comment
17-
uses: actions/github-script@v7
17+
- name: Checkout repository
18+
uses: actions/checkout@v3
19+
20+
- name: Add Comment on Pull Request
21+
if: ${{ github.event_name == 'pull_request' }}
22+
uses: peter-evans/create-or-update-comment@v3
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
repository: ${{ github.repository }}
26+
issue-number: ${{ github.event.pull_request.number }}
27+
body: |
28+
🚀 **Hello @${{ github.event.pull_request.user.login }}!**
29+
30+
Thank you for your contribution to the **Leetcode Journal** project! 🎉
31+
We value your effort and are excited to review your changes.
32+
33+
### PR Checklist:
34+
Please ensure your PR adheres to the following checklist:
35+
- [ ] PR description includes a summary and context for the changes.
36+
- [ ] Relevant dependencies have been listed.
37+
- [ ] Testing section is filled out with details on verification.
38+
- [ ] Screenshots/Videos are attached (if applicable).
39+
- [ ] Checklist items are marked as completed.
40+
41+
### Review Notifications:
42+
- **Project Admin:** @yashksaini-coder
43+
- **Mentor:** @ompharate
44+
45+
The team will review your PR shortly. If you have any questions, feel free to ask here!
46+
Happy Coding! 🚀
47+
48+
- name: Add Comment on Issue
49+
if: ${{ github.event_name == 'issues' }}
50+
uses: peter-evans/create-or-update-comment@v3
1851
with:
19-
github-token: ${{secrets.GITHUB_TOKEN}}
20-
script: |
21-
const issueComment = context.payload.issue
22-
? `Thank you for opening an issue, @${context.payload.issue.user.login}! will review it soon. Meanwhile you can describe & share your approach on how to resolve this issue.`
23-
: `Thank you for creating this pull request, @${context.payload.pull_request.user.login}! A reviewer will check it shortly.`;
24-
github.rest.issues.createComment({
25-
owner: context.repo.owner,
26-
repo: context.repo.repo,
27-
issue_number: context.issue.number,
28-
body: issueComment,
29-
});
52+
token: ${{ secrets.GITHUB_TOKEN }}
53+
repository: ${{ github.repository }}
54+
issue-number: ${{ github.event.issue.number }}
55+
body: |
56+
👋 **Hello @${{ github.event.issue.user.login }}!**
57+
58+
Thank you for raising an issue in the **Leetcode Journal** project!
59+
Your issue has been logged, and the team will review it shortly.
60+
61+
### Issue Handling Checklist:
62+
- [ ] Make sure the issue includes clear steps to reproduce (if applicable).
63+
- [ ] Provide relevant context, screenshots, or logs.
64+
- [ ] Mention if this issue blocks any critical workflows.
65+
66+
### Notifications:
67+
- **Project Admin:** @yashksaini-coder
68+
- **Mentor:** @ompharate
69+
70+
We'll get back to you soon. Stay tuned! 🚀

0 commit comments

Comments
 (0)