Add api-changes.yml workflow to replace danger-pr (#55341)

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

Changelog:
[INTERNAL] [CHANGED] - Add api-changes.yml workflow to replace danger-pr for detecting changes in the js api

  The workflow:
  - Triggers on `pull_request_target` for opened, edited, reopened, and synchronize events
  - Checks out the main branch (for security, using trusted code)
  - Runs the `diff-js-api-changes` action to detect API changes
  - Posts a PR comment using the generic `post-pr-comment` action

  The PR comment script creates, updates, or deletes a bot comment based on whether
  there are any sections to report, using a marker to identify existing bot comments.

Reviewed By: huntie

Differential Revision: D90991845

fbshipit-source-id: 753475a7c24df8bc581b2ab47bfad1f5551c823c
This commit is contained in:
Emily Brown authored and meta-codesync[bot] committed 2026-02-06 08:14:53 -08:00
1 parent 10709f427d
commit 6a9d792f9a
3 files changed
+119

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
name: Validate API snapshot changes
on:
pull_request_target:
types: [opened, edited, reopened, synchronize]
permissions:
pull-requests: write
jobs:
api-changes:
runs-on: ubuntu-latest
if: github.repository == 'facebook/react-native'
steps:
- name: Check out main branch
uses: actions/checkout@v6
- name: Setup Node.js
uses: ./.github/actions/setup-node
- name: Run yarn install
uses: ./.github/actions/yarn-install
- name: Run diff-js-api-changes
id: diff-js-api-changes
uses: ./.github/actions/diff-js-api-changes
- name: Post PR comment
uses: ./.github/actions/post-pr-comment
with:
marker: '<!-- api-changes -->'
sections: '[${{ toJSON(steps.diff-js-api-changes.outputs.message) }}]'