Skip to content

Commit cad04a4

Browse files
committed
Handle PRs landed via ghstack
1 parent 87d026e commit cad04a4

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

scripts/sync-react.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,8 +211,13 @@ async function getChangelogFromGitHub(baseSha, newSha) {
211211
}
212212
for (const { commit, sha } of commits) {
213213
const title = commit.message.split('\n')[0] || ''
214-
// The "title" looks like "[Fiber][Float] preinitialized stylesheets should support integrity option (#26881)"
215-
const match = /\(#([0-9]+)\)$/.exec(title)
214+
const match =
215+
// The "title" looks like "[Fiber][Float] preinitialized stylesheets should support integrity option (#26881)"
216+
/\(#([0-9]+)\)$/.exec(title) ??
217+
// or contains "Pull Request resolved: https://github.com/facebook/react/pull/12345" in the body if merged via ghstack (e.g. https://github.com/facebook/react/commit/0a0a5c02f138b37e93d5d93341b494d0f5d52373)
218+
/^Pull Request resolved: https:\/\/github.com\/facebook\/react\/pull\/([0-9]+)$/m.exec(
219+
commit.message
220+
)
216221
const prNum = match ? match[1] : ''
217222
if (prNum) {
218223
changelog.push(`- https://github.com/facebook/react/pull/${prNum}`)

0 commit comments

Comments
 (0)