Skip to content

feat(ci): notify Feishu for new pull requests - #270

Merged
tt-a1i merged 5 commits into
mainfrom
codex/feishu-pr-notification
Aug 29, 2026
Merged

tt-a1i merged 5 commits into
mainfrom
codex/feishu-pr-notification

Conversation

@junwu168

@junwu168 junwu168 commented Aug 29, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

New pull requests were not announced automatically in the project Feishu group, and public PR metadata could be interpreted as Feishu text markup if forwarded verbatim.

Value

The repository can notify the Feishu group immediately while keeping the webhook and signing secret protected, while hostile titles or other metadata cannot inject mentions or extra message fields.

Approach

Add a pull_request_target workflow for opened and ready-for-review events. It checks out only the trusted github.workflow_sha with credentials disabled, never PR code, then signs and sends a bounded six-line plain-text notification. All public PR metadata is projected through a Unicode-aware sanitizer before the HTTP payload is built. The workflow accepts both current and legacy Feishu success response formats.

Validation

  • Focused formatter and real local HTTP payload tests: 7/7 passed
  • bun run check: passed (258 files)
  • bun run test: passed (966 passed, 1 skipped)
  • git diff --check: passed
  • Two independent final reviews: no findings
  • Adversarial entity and Unicode matrix: 324 combinations, 0 bypass
  • Live Feishu notification: not sent; runtime acceptance requires the workflow on the default branch and a later matching PR event

Impact

User-visible behavior: Feishu receives one message for newly opened non-draft PRs and another whenever a draft is marked ready. Repeated draft-to-ready transitions intentionally produce repeated notifications.

Model-visible context/tools: None.

Runtime/lifecycle: Adds one bounded GitHub Actions job per relevant PR event.

Persisted config/data: Requires FEISHU_PR_BOT_WEBHOOK and FEISHU_PR_BOT_SECRET repository secrets.

Compatibility or risk: Benign notification text, signing, response handling, and missing/partial-secret behavior are preserved. Hostile, control, bidi, and overlong metadata is safely bounded.

@junwu168
junwu168 requested a review from tt-a1i as a code owner August 29, 2026 03:07
@junwu168
junwu168 requested a review from a team as a code owner August 29, 2026 04:29

@tt-a1i tt-a1i left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed exact head 7e1718a: trusted workflow checkout, bounded Feishu metadata projection, real HTTP payload coverage, full check and test suite green; two independent final reviews reported no findings.

@tt-a1i
tt-a1i requested a review from zhengkezhou1 August 29, 2026 05:35
@tt-a1i
tt-a1i merged commit fa21062 into main Aug 29, 2026
3 checks passed
agnitum2009 pushed a commit to agnitum2009/openpi that referenced this pull request Aug 29, 2026
* feat(ci): notify Feishu for new pull requests

* feat(ci): localize Feishu PR notification

* fix(ci): sanitize Feishu PR notifications

---------

Co-authored-by: tt-a1i <[email protected]>
Co-authored-by: tt-a1i <[email protected]>
(cherry picked from commit fa21062)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants