Skip to content

Commit eb7f2ec

Browse files
authored
Create Update autocomment-pr-merge.yml
1 parent 7a4f8a2 commit eb7f2ec

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Auto Comment on PR Merge
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
permissions:
8+
issues: write
9+
pull-requests: write
10+
11+
jobs:
12+
comment:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: write
16+
if: github.event.pull_request.merged == true
17+
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v2
21+
22+
- name: Add Comment to Issue
23+
env:
24+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
25+
run: |
26+
COMMENT=$(cat <<EOF
27+
{
28+
"body": "🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. \n\n I would be grateful if you can nominate for keeping this opensource project live and running [Link to Nominate](https://stars.github.com/nominate/). Please do star the repo and Keep up the fantastic work! 🚀"
29+
}
30+
EOF
31+
)
32+
curl -X POST \
33+
-H "Authorization: Bearer $GITHUB_TOKEN" \
34+
-H "Accept: application/vnd.github.v3+json" \
35+
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
36+
-d "$COMMENT"

0 commit comments

Comments
 (0)