Dashboard › craft › Distillation
7d859c76-3f13-4e6c-9426-4e63c95d06bf["lore_tm_v1_FlniuspZwHZ6ZmEi51whAmh3jShBC9Cx4qOuflhnKI0"]
Date: Sep 3, 2026
docs/publish-issue-format.md specifies compact publish-title grammar including optional legacy workspace syntax: legacy-workspace = " [workspace: ", json-string, "] "; examples include publish: getsentry/toolkit [workspace: "cli/v2"] @1.2.3 and publish: getsentry/toolkit [workspace: "cli [preview] \"next\""] @1.2.3.docs/publish-issue-format.md states root-workspace releases use one trailing path segment as the workspace name; Craft rejects a workspace with a non-root checkout path. For .craft.yml, craft workspace list supplies exact workspace keys; a suffix exactly matching a key is a workspace, while any other suffix remains a checkout path. Existing JSON-qualified workspace titles remain supported for compatibility; legacy workspace titles must use the repository root path.docs/publish-issue-format.md requires workspace names to be nonempty and contain no Unicode control (Cc), format, line-separator, or paragraph-separator characters; qualified workspace titles have one space after ] before @, while unqualified titles have no space there.src/modules/publish-location.js defines needsWorkspaceDiscovery({ path, workspace }) as !workspace && /^\.\/[A-Za-z0-9_.-]+$/.test(path).src/modules/publish-location.js, resolvePublishLocation({ path, workspace, workspaceNames }) rejects an explicit workspace unless path === "." with Error("A publish workspace must use the repository root path."); otherwise it preserves { path, workspace }.src/modules/publish-location.js, if workspace discovery is not needed, resolvePublishLocation() returns { path }; if workspaceNames contains invalid names according to isWorkspaceName, it throws Error("Craft workspace discovery returned an invalid workspace list."). An exact one-segment suffix matching workspaceNames resolves to { path: ".", workspace: segments[0] }; nonmatching suffixes and multi-segment paths remain checkout paths. Module exports { needsWorkspaceDiscovery, resolvePublishLocation }.src/publish/resolve-location.js invokes needsWorkspaceDiscovery(input); when discovery is required it validates that returned workspaceNames is an array or throws Craft workspace discovery returned an invalid workspace list., then resolves location using input.workspace and the discovered names.src/modules/details-from-context.js destructures { workspace: workspaceJson, ...parsedTitleDetails }, initializes workspace = "", parses workspaceJson with JSON.parse(), and throws Invalid publish workspace JSON in title: '${context.payload.issue.title}' on invalid JSON.src/modules/details-from-context.js rejects empty workspace names and names matching /[\p{Cc}\p{Cf}\p{Zl}\p{Zp}]/u with Workspace names must be nonempty and cannot contain Unicode control, format, or separator characters; it also rejects a nonempty workspace when path !== "." with A publish workspace must use the repository root path..github/workflows/publish.yml computes requires_workspace_discovery by invoking needsWorkspaceDiscovery(input) from ./.__publish__/src/modules/publish-location; when true and __repo__/.craft.yml exists, it executes getsentry/craft:latest workspace list in Docker with "$GITHUB_WORKSPACE/__repo__" mounted at /github/workspace/__repo__, then passes the result as CRAFT_WORKSPACE_NAMES..github/workflows/publish.yml sets CRAFT_PUBLISH_WORKSPACE and CRAFT_WORKSPACE from fromJSON(steps.location.outputs.result).workspace || ''; it derives container_cwd as realpath -m "/github/workspace/__repo__/$CRAFT_PUBLISH_PATH" and validates it remains /github/workspace/__repo__ or a descendant..github/workflows/publish.yml encodes a nonempty CRAFT_PUBLISH_WORKSPACE with base64 -w 0 | tr '+/' '-_' | tr -d '=', prefixes state filenames with workspace-${workspace_encoded}-, and creates publish-state-${owner_sanitised}-${repo_sanitised}-${cwd_hash}-${workspace_prefix}${version_sanitised}.json under $GITHUB_WORKSPACE/.craft-state/craft. It sets XDG_STATE_HOME: /github/workspace/.craft-state and documents that state follows issue checkout identity rather than a workspace identity.src/modules/__tests__/publish-location.js tests that { path: "./CLI" } with workspaceNames: ["cli", "CLI"] resolves exactly, without normalization, to { path: ".", workspace: "CLI" }; it also tests preservation of non-workspace suffixes as checkout paths, preservation of multi-segment paths even if their final segment is a workspace, and preservation of legacy explicit workspace "cli/v2".src/modules/__tests__/ci-poller-input.js tests compact and legacy workspace publish-title parsing, including publish: toolkit [workspace: "cli/v2"] @1.2.3.