[ci] Create unique preview build versions for canary previews (#93490)

This commit is contained in:
Sebastian "Sebbie" Silbermann
2026-05-05 15:39:45 +02:00
committed by GitHub
parent c8c9fc6a91
commit 7240c74b23
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ jobs:
- run: pnpm install
- name: Set preview version
if: ${{ contains(fromJSON('["automated-preview","force-preview"]'), needs.deploy-target.outputs.value) }}
if: ${{ contains(fromJSON('["automated-preview", "force-preview", "staging"]'), needs.deploy-target.outputs.value) }}
run: |
node scripts/set-preview-version.js "${{ github.sha }}"
pnpm install --no-frozen-lockfile
+3
View File
@@ -30,6 +30,9 @@ async function main() {
// 15.0.0-canary.17 -> 15.0.0
// 15.0.0 -> 15.0.0
const [semverStableVersion] = lernaConfig.version.split('-')
// This can create colliding versions between different forks which should be incredibly rare.
// Preview builds are installed by URL anyway which is unique between forks by
// controlling the repo var setting the preview builds base url.
const version = `${semverStableVersion}-preview-${shortSha}-${dateString}`
//
// Lerna version requires a non-detached HEAD