Skip to content

Commit ffdb981

Browse files
authored
Update auto-comment-on-pr-merge.yml
1 parent 35a2588 commit ffdb981

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

.github/workflows/auto-comment-on-pr-merge.yml

+13-8
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,16 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- name: Add Comment to Merged PR
14-
env:
15-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16-
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 contribution to our project. Your efforts are greatly appreciated. Keep up the fantastic work! 🚀"}' \
20-
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
13+
- name: Comment on merged PR
14+
uses: actions/github-script@v6
15+
with:
16+
github-token: ${{ secrets.GITHUB_TOKEN }}
17+
script: |
18+
const pr = context.payload.pull_request;
19+
const comment = `🎉 Congratulations @${pr.user.login}! Your pull request has been merged. Thank you for your contribution to the project.`;
20+
github.rest.issues.createComment({
21+
issue_number: pr.number,
22+
owner: context.repo.owner,
23+
repo: context.repo.repo,
24+
body: comment
25+
});

0 commit comments

Comments
 (0)