Skip to content

Commit

Permalink
Update auto-comment-on-pr-merge.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
ajay-dhangar authored May 25, 2024
1 parent 35a2588 commit ffdb981
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/auto-comment-on-pr-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,16 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Add Comment to Merged PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
curl -H "Authorization: token $GITHUB_TOKEN" \
-X POST \
-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! 🚀"}' \
"https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments"
- name: Comment on merged PR
uses: actions/github-script@v6
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const pr = context.payload.pull_request;
const comment = `🎉 Congratulations @${pr.user.login}! Your pull request has been merged. Thank you for your contribution to the project.`;
github.rest.issues.createComment({
issue_number: pr.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: comment
});

0 comments on commit ffdb981

Please sign in to comment.