Skip to content

Commit

Permalink
Merge pull request #91 from jinx-vi-0/jinx-vi-0-patch-1
Browse files Browse the repository at this point in the history
Update greetings.yml
  • Loading branch information
jinx-vi-0 authored Oct 12, 2024
2 parents 7884161 + e9cfbdc commit 89e8405
Showing 1 changed file with 26 additions and 4 deletions.
30 changes: 26 additions & 4 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
name: Greetings

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

jobs:
greeting:
Expand All @@ -9,8 +13,26 @@ jobs:
issues: write
pull-requests: write
steps:
- uses: actions/first-interaction@v1
- name: Greet on new issue
if: github.event_name == 'issues'
uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: "πŸ‘‹ Thank you for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!"
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: 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."

- name: Congratulate on merged pull request
if: github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged == true
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
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!\"}"

0 comments on commit 89e8405

Please sign in to comment.