-
Notifications
You must be signed in to change notification settings - Fork 89
48 lines (42 loc) · 2.17 KB
/
close_merged_pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
name: Comment on PR Closure
on:
pull_request_target:
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.🙇
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}.`);