Skip to content

--no-publish does not stop the auto-publish attempt #404

Closed

Description

@nc9

Signed in, squirrel audit <url> -m 1000 --http --no-publish -f html -o out.html (v0.0.97) ended with:

⚠ Could not auto-publish: Failed to connect to API: The operation timed out.

It should not have attempted to publish at all. The attempt only surfaced because the API call happened to fail; with a working connection the report would presumably have been published against the user's explicit opt-out.

resolvePublishDecision in apps/cli/src/cli/commands/audit.ts reads correct on its own (if (opts.noPublish || !opts.configPublish) return false), so the likely fault is upstream in how the flag arrives: parseAuditArgs reads args["no-publish"], and a --no-* flag next to an existing publish boolean is the classic case where the parser records the negation as publish: false and leaves no-publish undefined. Unverified: I could not reproduce the parse in isolation from this checkout, so treat that as a lead rather than the diagnosis.

Note validateAuditFlags already reads both args.no_publish and args.noPublish, which suggests this spelling has bitten before.

Acceptance Criteria

  • --no-publish on a signed-in run performs no publish attempt: no API call, no "Could not auto-publish" warning
  • A test covers the flag as the CLI parser actually delivers it, not as a hand-built options object
  • --no-publish combined with --publish still errors as it does today
  • The same check covers squirrel crawl if it accepts the flag

Activity

  1. nc9 commented on Sep 23, 2026

    @nc9
    ContributorAuthor

    Confirmed the parse lead. With citty 0.1.6 (the version apps/cli pins) and 0.2.2, a command that declares both a publish boolean and a no-publish boolean receives --no-publish as { publish: false }, with args["no-publish"] undefined. audit.ts reads !!args["no-publish"] (line 2115) and isAutoPublish = !args.publish (line 2103), so the run is treated as an auto-publish and resolvePublishDecision publishes whenever [cloud] publish is on.

  2. added
    bug
    P1
    size: S
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1bugsize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions