Skip to content

Commit

Permalink
Update greetings.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jinx-vi-0 authored Oct 16, 2024
1 parent 2b95bcb commit cc30e6d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Greetings

on:
pull_request_target:
types: [opened, synchronized, reopened, closed]
types: [opened, synchronized, reopened]
issues:
types: [opened]
types: [opened, closed]

jobs:
greeting:
Expand All @@ -14,25 +14,25 @@ jobs:
pull-requests: write
steps:
- name: Greet on new issue
if: github.event_name == 'issues'
if: github.event_name == 'issues' && github.event.action == 'opened'
uses: actions/first-interaction@v1
with:
issue-message: "πŸ‘‹ Thank you for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!"
issue-message: "Thank you for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!"

- name: Greet on new pull request
if: github.event_name == 'pull_request'
uses: actions/first-interaction@v1
with:
pr-message: "πŸŽ‰ Thank you for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better."
pr-message: "Thank you for your contribution! Your pull request has been submitted successfully. A maintainer will review it as soon as possible. We appreciate your support in making this project better."

- name: Congratulate on merged pull request
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
- name: Congratulate on closed issue
if: github.event_name == 'issues' && github.event.action == 'closed'
run: |
echo "Congratulations to @${{ github.event.pull_request.user.login }} for merging your pull request! πŸŽ‰"
echo "If you enjoyed contributing, please consider giving us a star on GitHub and following us for updates!"
# Post a comment on the PR
echo "Congratulations to @${{ github.event.issue.user.login }} for closing your issue!"
echo "If you enjoyed contributing, please consider giving us a ⭐ and following us for updates!"
# Post a comment on the issue
curl -X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/comments \
-d "{\"body\": \"Congratulations @${{ github.event.pull_request.user.login }} for merging your pull request! πŸŽ‰ If you enjoyed contributing, please consider giving us a star on GitHub and following us for updates!\"}"
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments \
-d "{\"body\": \"Congratulations to @${{ github.event.issue.user.login }} for closing your issue! If you enjoyed contributing, please consider giving us a star on GitHub and following us for updates!\"}"

0 comments on commit cc30e6d

Please sign in to comment.