forked from web-infra-dev/rspack
-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (34 loc) · 1.49 KB
/
issue-pr-trigger.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
name: Notify Lark on Issue and PR
on:
issues:
types: [opened]
pull_request:
types: [opened]
jobs:
notify-lark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20'
- name: Notify Lark for Issue
if: github.event_name == 'issues'
env:
LARK_WEBHOOK_URL: ${{ secrets.LARK_WEBHOOK_URL }}
ISSUE_TITLE: ${{ github.event.issue.title }}
AUTHOR_ID: ${{ github.event.issue.user.login }}
BODY: ${{ github.event.issue.body }}
URL: ${{ github.server_url }}/${{ github.repository }}/issues/${{ github.event.issue.number }}
run: |
SHORT_BODY=$(echo "$BODY" | head -n 3) TITLE="New Issue Opened: $ISSUE_TITLE" DESCRIPTION="Issue by @$AUTHOR_ID: $SHORT_BODY. View more at $URL" ./scripts/alert/lark.js
- name: Notify Lark for PR
if: github.event_name == 'pull_request'
env:
LARK_WEBHOOK_URL: ${{ secrets.LARK_WEBHOOK_URL }}
PR_TITLE: ${{ github.event.pull_request.title }}
AUTHOR_ID: ${{ github.event.pull_request.user.login }}
BODY: ${{ github.event.pull_request.body }}
URL: ${{ github.server_url }}/${{ github.repository }}/pull/${{ github.event.pull_request.number }}
run: |
SHORT_BODY=$(echo "$BODY" | head -n 3) TITLE="New PR Opened: $PR_TITLE" DESCRIPTION="PR by @$AUTHOR_ID: $SHORT_BODY. Check it out at $URL" ./scripts/alert/lark.js