Skip to content

Commit ba1a9de

Browse files
author
Riccardo
authored
[LOCAL] bypass tag check in dry run (#35428)
1 parent 6107793 commit ba1a9de

3 files changed

Lines changed: 15 additions & 9 deletions

File tree

scripts/bump-oss-version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ async function main() {
7676
);
7777
const token = argv.token;
7878
const releaseVersion = argv.toVersion;
79-
failIfTagExists(releaseVersion);
79+
failIfTagExists(releaseVersion, 'release');
8080

8181
const {pushed} = await inquirer.prompt({
8282
type: 'confirm',

scripts/prepare-package-for-release.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,13 @@ const releaseVersion = argv.toVersion;
5050
const isLatest = argv.latest;
5151
const isDryRun = argv.dryRun;
5252

53-
failIfTagExists(releaseVersion);
53+
const buildType = isDryRun
54+
? 'dry-run'
55+
: isReleaseBranch(branch)
56+
? 'release'
57+
: 'nightly';
58+
59+
failIfTagExists(releaseVersion, buildType);
5460

5561
if (branch && !isReleaseBranch(branch) && !isDryRun) {
5662
console.error(`This needs to be on a release branch. On branch: ${branch}`);
@@ -60,12 +66,6 @@ if (branch && !isReleaseBranch(branch) && !isDryRun) {
6066
exit(1);
6167
}
6268

63-
const buildType = isDryRun
64-
? 'dry-run'
65-
: isReleaseBranch(branch)
66-
? 'release'
67-
: 'nightly';
68-
6969
const {version} = parseVersion(releaseVersion, buildType);
7070
if (version == null) {
7171
console.error(`Invalid version provided: ${releaseVersion}`);

scripts/release-utils.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ function generateiOSArtifacts(
137137
return tarballOutputPath;
138138
}
139139

140-
function failIfTagExists(version) {
140+
function failIfTagExists(version, buildType) {
141+
// When dry-run in stable branch, the tag already exists.
142+
// We are bypassing the tag-existence check when in a dry-run to have the CI pass
143+
if (buildType === 'dry-run') {
144+
return;
145+
}
146+
141147
if (checkIfTagExists(version)) {
142148
echo(`Tag v${version} already exists.`);
143149
echo('You may want to rollback the last commit');

0 commit comments

Comments
 (0)