react/scripts/release/prepare-release-from-ci.js
lauren 44c4693539
[ci] Dont sign builds originating from anything other than facebook/react (#32738)
We now generate attestations in `process_artifacts_combined` so we can
verify the provenance of the build later in other workflows. However,
this requires `write` permissions for `id-token` and `attestations` so
PRs from forks cannot generate this attestation.

To get around this, I added a `--no-verify` flag to
scripts/release/download-experimental-build.js. This flag is only passed
in `runtime_build_and_test.yml` for the sizebot job, since 1) the
workflow runs in the `pull_request` trigger which has read-only
permissions, and 2) the downloaded artifact is only used for sizebot
calculation, and not actually used.

The flag is explicitly not passed in `runtime_commit_artifacts.yml`
since there we actually use the artifact internally. This is fine as
once a PR lands on main, it will then run the build on that new commit
and generate an attestation.
---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/32738).
* #32739
* __->__ #32738
2025-03-25 11:16:19 -04:00

39 lines
1.0 KiB
JavaScript
Executable File

#!/usr/bin/env node
'use strict';
const {join} = require('path');
const {addDefaultParamValue, handleError} = require('./utils');
const {
downloadBuildArtifacts,
} = require('./shared-commands/download-build-artifacts');
const parseParams = require('./shared-commands/parse-params');
const printPrereleaseSummary = require('./shared-commands/print-prerelease-summary');
const testPackagingFixture = require('./shared-commands/test-packaging-fixture');
const run = async () => {
try {
addDefaultParamValue(null, '--commit', 'main');
const params = await parseParams();
params.cwd = join(__dirname, '..', '..');
await downloadBuildArtifacts({
commit: params.commit,
releaseChannel: params.releaseChannel ?? process.env.RELEASE_CHANNEL,
});
if (!params.skipTests) {
await testPackagingFixture(params);
}
const isLatestRelease = params.releaseChannel === 'latest';
await printPrereleaseSummary(params, isLatestRelease);
} catch (error) {
handleError(error);
}
};
run();