forked from RubyMetric/chsrc
-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (48 loc) · 1.69 KB
/
Copy pathPR-notify.yml
File metadata and controls
54 lines (48 loc) · 1.69 KB
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
# ---------------------------------------------------------------
# Workflow File : PR-notify.yml
# File Authors : Aoran Zeng <ccmywish@qq.com>
# Contributors : Nul None <nul@none.org>
# |
# Created On : <2025-06-19>
# Last Modified : <2025-06-28>
#
# Notify PR
# ---------------------------------------------------------------
name: 告知PR者
on:
pull_request_target:
types: [opened,
ready_for_review, # draft PR 转为正式 PR
review_requested,
reopened]
jobs:
enforce-dev-branch:
name: 强制使用dev分支
runs-on: ubuntu-latest
# github.event.pull_request_target 内容为空,转而用 pull_request
if: github.event.pull_request.base.ref != 'dev'
steps:
- name: 评论
uses: thollander/actions-comment-pull-request@v3
with:
message: |
Hi @${{github.event.pull_request.user.login}},
❤️ 感谢你的贡献!你的 PR 当前基于 `${{github.base_ref}}` 分支,请修改使用 `dev` 分支
comment-tag: "❤️ 感谢你的贡献!"
- run: |
echo "::error::❌ PR 必须以 dev 分支为目标!当前是 ${GITHUB_BASE_REF}"
exit 1
welcome:
name: 欢迎PR者
runs-on: ubuntu-latest
if: github.event.pull_request.base.ref == 'dev'
steps:
- name: 评论
uses: peter-evans/create-or-update-comment@v4
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Hi @${{github.event.pull_request.user.login}},
❤️ 感谢你的贡献!我们将在5天内阅读此 PR 并回复你
edit-mode: replace
reactions: heart