From c420e8eda1beb955dcf04bc1eb5c71a5f7549484 Mon Sep 17 00:00:00 2001 From: tjq Date: Thu, 20 Aug 2026 11:30:03 -0400 Subject: [PATCH] docs: replace porter apply --validate with the validate subcommand The --validate flag never validated anything; it is being removed in porter-dev/code#7923. Document `porter apply validate -f porter.yaml` as the local validation path alongside --dry-run. Co-Authored-By: Claude Fable 5 --- .../cli/command-reference/porter-apply.mdx | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/standard/cli/command-reference/porter-apply.mdx b/standard/cli/command-reference/porter-apply.mdx index c1efbf1e..2f2e266c 100644 --- a/standard/cli/command-reference/porter-apply.mdx +++ b/standard/cli/command-reference/porter-apply.mdx @@ -75,9 +75,10 @@ You can pass environment variables and secrets directly via command-line flags w | Flag | Description | |------|-------------| -| `--validate` | Check that the `porter.yaml` file is valid YAML syntax | | `--dry-run` | Perform server-side validation to confirm the configuration is valid without applying changes | +To check a `porter.yaml` locally without building or deploying, use the [`porter apply validate`](#porter-apply-validate) subcommand. + ### Advanced Options | Flag | Short | Description | @@ -117,9 +118,9 @@ porter apply -f porter.yaml --wait porter apply -f porter.yaml --preview ``` -```bash Validate YAML Syntax -# Check that porter.yaml is valid YAML -porter apply -f porter.yaml --validate +```bash Validate Locally +# Check porter.yaml against the schema without building or deploying +porter apply validate -f porter.yaml ``` ```bash Dry Run @@ -146,6 +147,23 @@ porter apply -f porter.yaml --variables LOG_LEVEL=debug,NODE_ENV=production --se ``` +## `porter apply validate` + +Validate a `porter.yaml` file against the schema locally. This command does not build, push, or deploy, and does not contact the Porter API. + +**Usage:** +```bash +porter apply validate -f porter.yaml +``` + +**Options:** + +| Flag | Short | Description | +|------|-------|-------------| +| `--file` | `-f` | Path to the `porter.yaml` file (defaults to `porter.yaml` in the current directory) | + +On success the command prints `✓ porter.yaml is valid`. On failure it prints the validation error and exits non-zero. For server-side validation of the full configuration against your project, use `porter apply --dry-run`. + ## Workflow When you run `porter apply`, the following steps occur: