diff --git a/src/lib/build.ts b/src/lib/build.ts index dafc5d07f2f..975aa107d37 100644 --- a/src/lib/build.ts +++ b/src/lib/build.ts @@ -138,7 +138,7 @@ export const getRunBuildOptions = async ({ defaultConfig, deployHandler, deployId, - options: { context, cwd, debug, dry, json, offline, silent }, + options: { alias, context, cwd, debug, dry, json, offline, silent }, packagePath, skewProtectionToken, token, @@ -186,6 +186,7 @@ export const getRunBuildOptions = async ({ token: token ?? undefined, dry, debug, + branch: alias, context, mode: 'cli', telemetry: false, diff --git a/tests/integration/commands/deploy/deploy.test.ts b/tests/integration/commands/deploy/deploy.test.ts index 553d66cb9aa..1490cf5215c 100644 --- a/tests/integration/commands/deploy/deploy.test.ts +++ b/tests/integration/commands/deploy/deploy.test.ts @@ -1441,6 +1441,48 @@ describe.concurrent('deploy command', () => { }) }) + test('should use alias as the branch for both the deploy request and the build', async (t) => { + await withMockDeploy(async (mockApi) => { + await withSiteBuilder(t, async (builder) => { + builder + .withContentFile({ + path: 'public/index.html', + content: '