Skip to content

Commit c53bd62

Browse files
committed
Fix run condition for PR
1 parent 6120d98 commit c53bd62

1 file changed

Lines changed: 4 additions & 7 deletions

File tree

.github/workflows/PR-notify.yml

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Contributors : Nul None <nul@none.org>
55
# |
66
# Created On : <2025-06-19>
7-
# Last Modified : <2025-06-20>
7+
# Last Modified : <2025-06-28>
88
#
99
# Notify PR
1010
# ---------------------------------------------------------------
@@ -22,7 +22,8 @@ jobs:
2222
enforce-dev-branch:
2323
name: 强制使用dev分支
2424
runs-on: ubuntu-latest
25-
if: github.event.pull_request_target.base.ref != 'dev'
25+
# github.event.pull_request_target 内容为空,转而用 pull_request
26+
if: github.event.pull_request.base.ref != 'dev'
2627
steps:
2728
- name: 评论
2829
uses: thollander/actions-comment-pull-request@v3
@@ -31,17 +32,13 @@ jobs:
3132
❤️ 感谢你的贡献!你的 PR 当前基于 ${{github.base_ref}} 分支,请修改使用 `dev` 分支!
3233
comment-tag: "❤️ 感谢你的贡献!"
3334
- run: |
34-
echo "github.event.pull_request_target.base.label = [${{github.event.pull_request_target.base.label}}]"
35-
echo "github.event.pull_request_target.base.ref = [${{github.event.pull_request_target.base.ref}}]"
36-
echo "github.event.pull_request.base.label = [${{github.event.pull_request.base.label}}]"
37-
echo "github.event.pull_request.base.ref = [${{github.event.pull_request.base.ref}}]"
3835
echo "::error::❌ PR 必须以 dev 分支为目标!当前是 ${GITHUB_BASE_REF}"
3936
exit 1
4037
4138
welcome:
4239
name: 欢迎PR者
4340
runs-on: ubuntu-latest
44-
if: github.event.pull_request_target.base.ref == 'dev'
41+
if: github.event.pull_request.base.ref == 'dev'
4542
steps:
4643
- name: 评论
4744
if: github.event.pull_request.type == 'opened'

0 commit comments

Comments
 (0)