Skip to content

Commit

Permalink
Fix integration commit comparison link for new nightly builds (#8792)
Browse files Browse the repository at this point in the history
* Fix integration commit comparison link for new nightly builds

Same fix as #8778 but in a different package. Ideally we would share this code, but this doesn't quite seem worth the overhead of a new shared package yet.

* Change files
  • Loading branch information
NickGerleman authored Oct 8, 2021
1 parent e7735a8 commit 26c0369
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "Fix integration commit comparison link for new nightly builds",
"packageName": "@rnw-scripts/integrate-rn",
"email": "[email protected]",
"dependentChangeType": "patch"
}
5 changes: 3 additions & 2 deletions packages/@rnw-scripts/integrate-rn/src/integrateRN.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ function refFromVersion(reactNativeVersion: string): string {
}

// Stable releases of React Native use a tag where nightly releases embed
// a commit hash into the prerelease tag of 0.0.0 versions
// a commit hash into the prerelease tag of 0.0.0 versions as either
// 0.0.0-<commitHash> or 0.0.0-<commitHash>-<date>-<time>
if (semver.lt(reactNativeVersion, '0.0.0', {includePrerelease: true})) {
return semver.prerelease(reactNativeVersion)![0];
return semver.prerelease(reactNativeVersion)![0].split('-')[0];
} else {
return `v${reactNativeVersion}`;
}
Expand Down

0 comments on commit 26c0369

Please sign in to comment.