Skip to content

Commit

Permalink
Changed the close and merge PR greets
Browse files Browse the repository at this point in the history
  • Loading branch information
dishamodi0910 committed Sep 30, 2023
1 parent 2f8e279 commit ec5cf27
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 26 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/close_merged_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Comment on PR Closure

on:
pull_request:
types:
- closed

jobs:
comment:
runs-on: ubuntu-latest

steps:
- name: Check PR Merge Status
id: pr_status
run: echo "::set-output name=merged::${{ github.event.pull_request.merged }}"

- name: Comment on PR Closure
if: steps.pr_status.outputs.merged == 'true'
uses: actions/github-script@v4
with:
github-token: ${{ secrets.APIVerse_SECRET }}
script: |
const { owner, repo, number } = context.issue;
const commentAuthor = context.payload.pull_request.user.login;
const commentBody = `@{{ commentAuthor }} We're thrilled to inform you that your pull request has been successfully merged into the APIverse🚀🎁
Your hard work, dedication, and expertise have made a significant impact on our project, and we couldn't be more grateful for your contributions.😇
Your code will now be a part of our growing ecosystem, helping developers worldwide to create exceptional APIs.❣️🔥
Happy Coding! ✨
Will See you soon❣️`;
await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody });
console.log(`Commented on the closed PR: ${commentBody}.`);
- name: Comment on PR Closure
if: steps.pr_status.outputs.merged != 'true'
uses: actions/github-script@v4
with:
github-token: ${{ secrets.APIVerse_SECRET }}
script: |
const { owner, repo, number } = context.issue;
const commentAuthor = context.payload.pull_request.user.login;
const commentBody = `@{{ commentAuthor }} ,I wanted to reach out and let you know that we have decided to close your pull request.🙇
While we truly appreciate your effort and dedication in contributing to our project, after careful consideration, we have determined that this particular PR may not align with our current goals or requirements.😢
In case of any issues, you can contact us on [Discord](https://discord.gg/mv4NTzN).
Thank you! ❣️
Happy Coding! ✨
Will See you soon❣️`;
await github.issues.createComment({ owner, repo, issue_number: number, body: commentBody });
console.log(`Commented on the closed PR: ${commentBody}.`);
26 changes: 0 additions & 26 deletions .github/workflows/pr_comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ on:
pull_request:
types:
- opened
- closed

jobs:
run:
Expand All @@ -23,28 +22,3 @@ jobs:
Will See you soon❣️
- name : Merging pull Request
uses : wow-actions/auto-comment@v1
with :
GITHUB_TOKEN : ${{ secrets.APIVerse_SECRET }}
pullRequestMerged: |
@{{ author }} We're thrilled to inform you that your pull request has been successfully merged into the APIverse🚀🎁
Your hard work, dedication, and expertise have made a significant impact on our project, and we couldn't be more grateful for your contributions.😇
Your code will now be a part of our growing ecosystem, helping developers worldwide to create exceptional APIs.❣️🔥
Happy Coding! ✨
Will See you soon❣️
- name : Closing pull Request
uses : wow-actions/auto-comment@v1
with :
GITHUB_TOKEN : ${{ secrets.APIVerse_SECRET }}
pullRequestClosed: |
@{{ author }} ,I wanted to reach out and let you know that we have decided to close your pull request.🙇
While we truly appreciate your effort and dedication in contributing to our project, after careful consideration, we have determined that this particular PR may not align with our current goals or requirements.😢
In case of any issues, you can contact us on [Discord](https://discord.gg/mv4NTzN).
Thank you! ❣️
Happy Coding! ✨
Will See you soon❣️

0 comments on commit ec5cf27

Please sign in to comment.