Skip to content

Commit 1a18b1a

Browse files
committed
Fix sync-react changelog
Seems like their API either changed or broke. But page 0 and 1 are now equal. We also no longer need to include the base.
1 parent 3d4ab35 commit 1a18b1a

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

scripts/sync-react.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ function extractInfoFromReactVersion(reactVersion) {
204204
async function getChangelogFromGitHub(baseSha, newSha) {
205205
const pageSize = 50
206206
let changelog = []
207-
for (let currentPage = 0; ; currentPage++) {
207+
for (let currentPage = 1; ; currentPage++) {
208208
const url = `https://api.github.com/repos/facebook/react/compare/${baseSha}...${newSha}?per_page=${pageSize}&page=${currentPage}`
209209
const headers = {}
210210
// GITHUB_TOKEN is optional but helps in case of rate limiting during development.
@@ -221,10 +221,7 @@ async function getChangelogFromGitHub(baseSha, newSha) {
221221
}
222222
const data = await response.json()
223223

224-
const { base_commit, commits } = data
225-
if (currentPage === 0) {
226-
commits.unshift(base_commit)
227-
}
224+
const { commits } = data
228225
for (const { commit, sha } of commits) {
229226
const title = commit.message.split('\n')[0] || ''
230227
const match =

0 commit comments

Comments
 (0)