SIGN IN SIGN UP
facebook / react-native UNCLAIMED

A framework for building native applications using React

Add PR body validation to analyze-pr workflow (#55382)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/55382

This adds a `validatePRBody.js` script that checks pull request descriptions for required sections as part of a new `analyze-pr.yml` workflow that will replace part of the Danger-pr workflow.

The validation includes:
- **Description length check**: Fails if the PR body is missing or less than 50 characters
- **Summary section check**: Warns if the PR lacks a "## Summary" section
- **Test plan check**: Warns if the PR lacks a "## Test Plan" section
- **Changelog validation**: failing if missing or invalid

Key behaviors:
- Phabricator-sourced PRs (detected via "Differential Revision:" in body) skip summary, test plan, and changelog validation since these are enforced differently
- Validation messages use GitHub's `[!WARNING]` and `[!CAUTION]` callout syntax for clear visual feedback
- The workflow fails (via `core.setFailed`) when any required check fails
- Messages are passed to `postPRComment` alongside API changes for consolidated PR comments

This aims to mimic relevant parts of dangerfile.js

Changelog: [Internal]

Reviewed By: huntie

Differential Revision: D91158803

fbshipit-source-id: 2304251d18f9fc8bf9a29e536fff2d979573bd86
E
Emily Brown committed
5e41043fb5808ae5392f8b564c4844f843367896
Parent: 6a9d792
Committed by meta-codesync[bot] <215208954+meta-codesync[bot]@users.noreply.github.com> on 2/6/2026, 4:14:53 PM