Remove unnecessary CIRCLE_CI_API_TOKEN checks (#26499)

Token is not required for GET
This commit is contained in:
Mengdi Chen
2023-03-28 16:31:34 -04:00
committed by GitHub
parent 305d58c173
commit b4e9cffab4
3 changed files with 2 additions and 20 deletions
-2
View File
@@ -354,8 +354,6 @@ yarn
./download-experimental-build.js --commit=main
```
Please note that you might need to [create a Circle CI API Token](https://circleci.com/docs/2.0/managing-api-tokens/) and set up an environment variable `CIRCLE_CI_API_TOKEN`.
## Build steps
Once the above packages have been built or downloaded, you can watch for changes made to the source code and automatically rebuild by running:
```sh
@@ -22,15 +22,9 @@ const run = async ({build, cwd, releaseChannel}) => {
}
// Download and extract artifact
const {CIRCLE_CI_API_TOKEN} = process.env;
if (CIRCLE_CI_API_TOKEN == null) {
throw new Error(
`Expected a CircleCI token to download artifacts, got ${CIRCLE_CI_API_TOKEN}`
);
}
await exec(`rm -rf ./build`, {cwd});
await exec(
`curl -L $(fwdproxy-config curl) ${buildArtifacts.url} -H "Circle-Token: ${CIRCLE_CI_API_TOKEN}" | tar -xvz`,
`curl -L $(fwdproxy-config curl) ${buildArtifacts.url} | tar -xvz`,
{
cwd,
}
+1 -11
View File
@@ -59,18 +59,8 @@ const extractCommitFromVersionNumber = version => {
};
const getArtifactsList = async buildID => {
const {CIRCLE_CI_API_TOKEN} = process.env;
if (CIRCLE_CI_API_TOKEN == null) {
throw new Error(
`Expected a CircleCI token to download artifacts, got ${CIRCLE_CI_API_TOKEN}`
);
}
const jobArtifactsURL = `https://circleci.com/api/v1.1/project/github/facebook/react/${buildID}/artifacts`;
const jobArtifacts = await fetch(jobArtifactsURL, {
headers: {
'Circle-Token': CIRCLE_CI_API_TOKEN,
},
});
const jobArtifacts = await fetch(jobArtifactsURL);
return jobArtifacts.json();
};