Skip to content

fix(deploy): remove messages about future deprecated flag removals #7252

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions docs/commands/deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,17 @@ netlify deploy
**Flags**

- `alias` (*string*) - Specifies the alias for deployment, the string at the beginning of the deploy subdomain. Useful for creating predictable deployment URLs. Avoid setting an alias string to the same value as a deployed branch. `alias` doesn’t create a branch deploy and can’t be used in conjunction with the branch subdomain feature. Maximum 37 characters.
- `branch` (*string*) - Serves the same functionality as --alias. Deprecated and will be removed in future versions
- `context` (*string*) - Specify a deploy context for environment variables read during the build (”production”, ”deploy-preview”, ”branch-deploy”, ”dev”) or `branch:your-branch` where `your-branch` is the name of a branch (default: dev)
- `dir` (*string*) - Specify a folder to deploy
- `filter` (*string*) - For monorepos, specify the name of the application to run the command in
- `functions` (*string*) - Specify a functions folder to deploy
- `json` (*boolean*) - Output deployment data as JSON
- `message` (*string*) - A short message to include in the deploy log
- `no-build` (*boolean*) - Do not run build command before deploying. Only use this if you have no need for a build or your site has already been built.
- `open` (*boolean*) - Open site after deploy
- `prod-if-unlocked` (*boolean*) - Deploy to production if unlocked, create a draft otherwise
- `debug` (*boolean*) - Print debugging information
- `auth` (*string*) - Netlify auth token - can be used to run this command without logging in
- `open` (*boolean*) - Open site after deploy
- `prod` (*boolean*) - Deploy to production
- `site` (*string*) - A site name or ID to deploy to
- `skip-functions-cache` (*boolean*) - Ignore any functions created as part of a previous `build` or `deploy` commands, forcing them to be bundled again as part of the deployment
Expand Down
13 changes: 3 additions & 10 deletions src/commands/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,7 @@ Support for package.json's main field, and intrinsic index.js entrypoints are co
'--alias <name>',
'Specifies the alias for deployment, the string at the beginning of the deploy subdomain. Useful for creating predictable deployment URLs. Avoid setting an alias string to the same value as a deployed branch. `alias` doesn’t create a branch deploy and can’t be used in conjunction with the branch subdomain feature. Maximum 37 characters.',
)
.option(
'-b, --branch <name>',
'Serves the same functionality as --alias. Deprecated and will be removed in future versions',
)
.addOption(new Option('-b, --branch <name>', 'Do not use - renamed to --alias.').hideHelp(true))
.option('-O, --open', 'Open site after deploy', false)
.option('-m, --message <message>', 'A short message to include in the deploy log')
.option('-s, --site <name-or-id>', 'A site name or ID to deploy to', env.NETLIFY_SITE_ID)
Expand Down Expand Up @@ -152,15 +149,11 @@ For more information about Netlify deploys, see ${terminalLink(docsUrl, docsUrl)
})
.action(async (options: DeployOptionValues, command: BaseCommand) => {
if (options.build && command.getOptionValueSource('build') === 'cli') {
warn(
`${chalk.cyanBright(
'--build',
)} is now the default and can safely be omitted. This will fail in a future version.`,
)
warn(`${chalk.cyanBright('--build')} is now the default and can safely be omitted.`)
}

if (options.branch) {
warn('--branch flag has been renamed to --alias and will be removed in future versions')
warn('--branch flag has been renamed to --alias')
}

if (options.context && !options.build) {
Expand Down
4 changes: 1 addition & 3 deletions tests/integration/commands/deploy/deploy.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,9 +327,7 @@ describe.skipIf(process.env.NETLIFY_TEST_DISABLE_LIVE === 'true').concurrent('co
env: { NETLIFY_SITE_ID: context.siteId },
})

t.expect(output).toMatch(
/--build.+is now the default and can safely be omitted. This will fail in a future version./,
)
t.expect(output).toMatch(/--build.+is now the default and can safely be omitted./)

t.expect(output).toContain('Netlify Build completed in')
const [, deployId] = output.match(/DEPLOY_ID: (\w+)/) ?? []
Expand Down
Loading