Skip to content

Commit 1c195f2

Browse files
authored
Update autocomment-pr-merge.yml
1 parent fe8e4f8 commit 1c195f2

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

.github/workflows/autocomment-pr-merge.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,33 @@ on:
44
pull_request:
55
types: [closed]
66

7+
permissions:
8+
issues: write
9+
pull-requests: write
10+
711
jobs:
8-
notify:
9-
if: github.event.pull_request.merged == true
12+
comment:
1013
runs-on: ubuntu-latest
14+
permissions:
15+
pull-requests: write
16+
if: github.event.pull_request.merged == true
1117

1218
steps:
13-
- name: Post merge comment
19+
- name: Checkout Repository
20+
uses: actions/checkout@v2
21+
22+
- name: Add Comment to Issue
1423
env:
1524
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1625
run: |
17-
curl -H "Authorization: token $GITHUB_TOKEN" \
18-
-X POST \
19-
-d '{"body":"🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. Keep up the fantastic work! 🚀"}' \
20-
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
26+
COMMENT=$(cat <<EOF
27+
{
28+
"body": "🎉 Your pull request has been successfully merged! 🎉 Thank you for your valuable contribution to our project. Your efforts are greatly appreciated. Feel free to reach out if you have any more contributions or if there's anything else we can assist you with. 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)