Files
babel/scripts/integration-tests/utils/e2e-check.js
c32965b97c chore: Resolve E2E test failures in forked repos (#15120)
* improve

* Update scripts/integration-tests/utils/e2e-check.js

Co-authored-by: Nicolò Ribaudo <[email protected]>

* review

* Update scripts/integration-tests/utils/e2e-check.js

Co-authored-by: Huáng Jùnliàng <[email protected]>

* review

* review

* Update scripts/integration-tests/utils/e2e-check.js

Co-authored-by: Huáng Jùnliàng <[email protected]>

Co-authored-by: Nicolò Ribaudo <[email protected]>
Co-authored-by: Huáng Jùnliàng <[email protected]>
2022-11-04 14:12:24 -04:00

22 lines
565 B
JavaScript

import fs from "fs";
const resp = await fetch(
"https://raw.githubusercontent.com/babel/babel/main/package.json"
);
const mainRepoPackageJson = await resp.json();
if (
mainRepoPackageJson.version !==
JSON.parse(fs.readFileSync("package.json")).version
) {
if (process.env.GITHUB_REPOSITORY === "babel/babel") {
console.error("The branch is not up to date with main, please rebase");
process.exitCode = 1;
} else {
console.error(
"The branch is not up to date with main of babel/babel, skipping"
);
process.exitCode = 10;
}
}