-
Notifications
You must be signed in to change notification settings - Fork 124
75 lines (68 loc) · 2.51 KB
/
auto-comment.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Automate Issue and PR Responses
on:
issues:
types:
- opened
- closed
pull_request:
types:
- opened
- closed
jobs:
respond-to-events:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
# Respond to new issues
- name: Respond to new issues
if: ${{ github.event_name == 'issues' && github.event.action == 'opened' }}
run: |
echo "Hey @${{ github.actor }}, Welcome to 💖coffeeShop! 🎊" > comment.txt
echo "Thanks for opening an issue! 🙌 Please wait for the issue to be assigned." >> comment.txt
echo "Happy Coding!! ✨" >> comment.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body-path: comment.txt
# Respond to closed issues
- name: Respond to closed issues
if: ${{ github.event_name == 'issues' && github.event.action == 'closed' }}
run: |
echo "Hello @${{ github.event.issue.user.login }}! Your issue #${{ github.event.issue.number }} has been closed." > comment.txt
echo "Thank you for your contribution to 💖coffeeShop!!! 🙌" >> comment.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body-path: comment.txt
# Respond to new PRs
- name: Respond to new PRs
if: ${{ github.event_name == 'pull_request' && github.event.action == 'opened' }}
run: |
echo "Hey @${{ github.actor }}, Welcome to 💖coffeeShop 🎊" > comment.txt
echo "Thanks for your contribution! Your effort makes this project better. Keep it up! 🙌" >> comment.txt
echo "Please wait for the PR to be reviewed." >> comment.txt
echo "Happy Coding!! ✨" >> comment.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body-path: comment.txt
# Respond to merged PRs
- name: Respond to merged PRs
if: ${{ github.event_name == 'pull_request' && github.event.action == 'closed' && github.event.pull_request.merged }}
run: |
echo "@${{ github.event.pull_request.user.login }} Congrats, Your pull request has been successfully merged 🥳🎉" > comment.txt
echo "Thank you for your contribution to 💖coffeeShop!!" >> comment.txt
echo "Happy coding 🎊, Keep Contributing 🙌 !!!" >> comment.txt
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.pull_request.number }}
body-path: comment.txt