-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #224 from aditiverma-21/main
Implement a Github Workflow for Issues and PR Auto-comment
- Loading branch information
Showing
2 changed files
with
82 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
name: PR Auto-comment | ||
|
||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- closed | ||
|
||
jobs: | ||
auto_comment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Comment on PR when opened | ||
if: github.event.action == 'opened' | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.pull_request.number, | ||
body: `Thank you for opening this Pull Request! We appreciate your effort and contribution to improving our project. Please ensure you’ve followed all the guidelines and that your PR meets our contribution standards. Happy coding! 🚀` | ||
}) | ||
- name: Comment on PR when merged | ||
if: github.event.action == 'closed' && github.event.pull_request.merged == true | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.pull_request.number, | ||
body: `This Pull Request has been successfully merged! 🎉 Thank you for your contribution and for helping us improve the project. We look forward to more contributions from you! 🚀` | ||
}) | ||
- name: Comment on PR when closed without merging | ||
if: github.event.action == 'closed' && github.event.pull_request.merged == false | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.pull_request.number, | ||
body: `This Pull Request was closed without merging. Thank you for your efforts! If there's anything we can do to help with future contributions, let us know. Happy coding! 🚀` | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
name: Issue Auto-comment | ||
|
||
on: | ||
issues: | ||
types: | ||
- opened | ||
- closed | ||
|
||
jobs: | ||
auto_comment: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Comment on Issue when opened | ||
if: github.event.action == 'opened' | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.issue.number, | ||
body: `Thanks for opening this issue! We appreciate your contribution. Please make sure you’ve provided all the necessary details and screenshots, and don't forget to follow our Guidelines and Code of Conduct. Happy coding! 🚀` | ||
}) | ||
- name: Comment on Issue when closed | ||
if: github.event.action == 'closed' | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
github.rest.issues.createComment({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.payload.issue.number, | ||
body: `This issue has been successfully closed. Thank you for your contribution and helping us improve the project! If you have any more ideas or run into other issues, feel free to open a new one. Happy coding! 🚀` | ||
}) |