Skip to content

fix(ci): skip Lark notification for fork pull requests - #114

Merged
TechQuery merged 2 commits into
mainfrom
fix/skip-lark-notification-for-fork-prs
Aug 25, 2026
Merged

fix(ci): skip Lark notification for fork pull requests#114
TechQuery merged 2 commits into
mainfrom
fix/skip-lark-notification-for-fork-prs

Conversation

@luojiyin1987

@luojiyin1987 luojiyin1987 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

PR-114 PR-114 PR-114 Powered by Pull Request Badge

Fixes #113

改动

.github/workflows/Lark-notification.yml 的发送步骤增加 secret 判空条件。GitHub Actions 规定 if: 不能直接引用 secrets.*,所以先把 secret 是否存在映射为 job 级 env:

env:
  HAS_LARK_WEBHOOK: ${{ secrets.LARK_CHATBOT_HOOK_URL != '' }}

# ...

if: ${{ contains(steps.message.outputs.content, ':') && env.HAS_LARK_WEBHOOK == 'true' }}

fork PR 拿不到仓库 secrets 时跳过发送,不再以空 URL 调用 feishu-action 导致 No URL protocol specified、Check 变红。env 里只放布尔标志,hook URL 的暴露范围保持不变(仅 feishu-action 步骤)。

行为对照

场景 之前 之后
push / issues / discussions / release 发送 不变
仓库内分支的 PR 发送 不变
fork PR(含 review comment) 失败变红 跳过发送

不采用 pull_request_target:workflow 会执行仓库内脚本(transform-message.ts),在该事件下 checkout 外部 PR 代码并暴露 secrets 有泄露风险。

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • .github/workflows/Lark-notification.yml is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 8715a9d1-d8d2-4315-9db8-d3772c8ae239

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@TechQuery TechQuery added the bug Something isn't working label Aug 25, 2026
@TechQuery
TechQuery merged commit b9847f6 into main Aug 25, 2026
4 of 5 checks passed
@TechQuery
TechQuery deleted the fix/skip-lark-notification-for-fork-prs branch August 25, 2026 11:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fork PR 触发 Lark notification 失败:secrets 不可用导致空 URL

2 participants