-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (29 loc) · 1.27 KB
/
pr_closed.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
name: PR Closure
on:
pull_request:
types:
- closed
jobs:
comment:
runs-on: ubuntu-latest
steps:
- name: Check if PR is merged
id: check_pr
run: |
if [ "${{ github.event.pull_request.merged }}" = "true" ]; then
echo "::set-output name=pr_status::merged"
echo "::set-output name=contributor::${{ github.event.pull_request.user.login }}"
else
echo "::set-output name=pr_status::not_merged"
echo "::set-output name=contributor::${{ github.event.pull_request.user.login }}"
fi
- name: Post Discord Message
if: always()
run: |
contributor="${{ steps.check_pr.outputs.contributor }}"
if [ "${{ steps.check_pr.outputs.pr_status }}" = "merged" ]; then
message=":tada: The pull request from @$contributor was successfully merged! Thank you for your contribution. Join our Discord server to connect with the community: [Discord](https://discord.gg/mv4NTzN)"
else
message=":cry: Unfortunately, the pull request from @$contributor was not merged. We appreciate your contribution! Join our Discord server to connect with the community: [Discord](https://discord.gg/mv4NTzN)"
fi
echo "$message"