-
Notifications
You must be signed in to change notification settings - Fork 312
70 lines (62 loc) · 3.04 KB
/
post-github-activity-pr.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
name: Post - Github activity (PRs)
on:
pull_request_target:
types:
- opened
- review_requested
- closed
jobs:
run:
runs-on: ubuntu-latest
if: ${{ github.repository_owner == 'sofa-framework' }}
env:
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_MAIN_WEBHOOK_URL }}
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install pip packages
run: |
pip install python-graphql-client
pip install python-dateutil
pip install requests
working-directory: ${{ github.workspace }}
# PR opened
- name: Run script post-discord-message.py for PR opened
if: ${{ github.event.action == 'opened' }}
run: |
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
env:
MESSAGE: ":new: PR opened: [#${{github.event.pull_request.number}} ${{github.event.pull_request.title}}](https://github.com/sofa-framework/sofa/pull/${{github.event.pull_request.number}})"
BOT_NAME: "SOFA Github bot"
EMBEDS_TITLE: "#${{github.event.pull_request.number}} ${{github.event.pull_request.title}}"
EMBEDS_URL: "https://github.com/sofa-framework/sofa/pull/${{github.event.pull_request.number}}"
EMBEDS_DESCRIPTION: "Authored by @${{github.event.pull_request.user.login}}\nLabels: ${{ join(github.event.pull_request.labels.*.name, ', ') }}"
# PR merged
- name: Run script post-discord-message.py for PR merged
if: ${{ github.event.action == 'closed' && github.event.pull_request.merged == true }}
run: |
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
env:
MESSAGE: ":raised_hands: Thanks [@${{github.event.pull_request.merged_by.login}}](https://github.com/${{github.event.pull_request.merged_by.login}}) for merging PR [#${{github.event.pull_request.number}} ${{github.event.pull_request.title}}](https://github.com/sofa-framework/sofa/pull/${{github.event.pull_request.number}}) authored by @${{github.event.pull_request.user.login}}"
BOT_NAME: "SOFA Github bot"
EMBEDS_TITLE: ""
EMBEDS_URL: ""
EMBEDS_DESCRIPTION: ""
# PR review requested event
- name: Run script post-discord-message.py for PR review request
if: ${{ github.event.action == 'review_requested' }}
run: |
python scripts/discord/post-discord-message.py
working-directory: ${{ github.workspace }}
env:
MESSAGE: ":eyeglasses: Review requested: ${{ join(github.event.pull_request.requested_reviewers.*.login, ', ') }} would you please review [#${{github.event.pull_request.number}}](https://github.com/sofa-framework/sofa/pull/${{github.event.pull_request.number}})?"
BOT_NAME: "SOFA Github bot"
EMBEDS_TITLE: ""
EMBEDS_URL: ""
EMBEDS_DESCRIPTION: ""