windmill-labs/windmill · warning

Example: "file.variable.yaml" → "file.${sanitizedBranchName}

Error message

Example: "file.variable.yaml" → "file.${sanitizedBranchName}.variable.yaml"

What it means

The third line of the same sanitization advisory from `validateBranchConfiguration`. It shows a concrete example of the transformation: a branch-specific file such as `file.variable.yaml` will be stored as `file.<sanitizedBranchName>.variable.yaml`. Purely informational, helping developers predict where their branch-specific files will land on disk.

Source

Thrown at cli/src/core/conf.ts:491

        (await Confirm.prompt({
          message: `Create empty workspace configuration for branch '${currentBranch}'?`,
          default: true,
        }));

      if (shouldCreate) {
        // Warn if branch name contains filesystem-unsafe characters
        if (/[\/\\:*?"<>|.]/.test(currentBranch)) {
          const sanitizedBranchName = currentBranch.replace(
            /[\/\\:*?"<>|.]/g,
            "_"
          );
          log.warn(
            `⚠️  WARNING: Branch name "${currentBranch}" contains filesystem-unsafe characters (/ \\ : * ? " < > | .).`
          );
          log.warn(
            `   Branch-specific files will be saved with sanitized name: "${sanitizedBranchName}"`
          );
          log.warn(
            `   Example: "file.variable.yaml" → "file.${sanitizedBranchName}.variable.yaml"`
          );
        }

        // Read current config, add workspace entry, and write it back
        const currentConfig = await readConfigFile();

        if (!currentConfig.workspaces) {
          currentConfig.workspaces = {} as WorkspacesConfig;
        }
        (currentConfig.workspaces as any)[currentBranch] = {};

        await writeFile("wmill.yaml", yamlStringify(currentConfig), "utf-8");

        log.info(
          `✅ Created empty workspace configuration for '${currentBranch}'`
        );
      } else {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Use the shown example to locate branch-specific files (search for `file.<sanitized>.variable.yaml`).
  2. Rename the branch to avoid sanitization if the file names matter to your tooling.
  3. Pre-define the workspace entry in `wmill.yaml` to control naming yourself.

Example fix

// before: branch "feat/login" → file.feat_login.variable.yaml
// after: branch "feat-login" → file.feat-login.variable.yaml
Defensive patterns

Strategy: fallback

Validate before calling

const branch = $("git branch --show-current").trim();
const sanitized = branch.replace(/[\/\\:*?"<>|.]/g, "_");
console.log(`Expect branch-specific files like file.${sanitized}.variable.yaml`);

Prevention

When it happens

Trigger: Identical trigger path: interactive create-workspace prompt accepted for an unmatched branch whose name matches `/[\/\\:*?"<>|.]/`, producing the example string with `sanitizedBranchName` interpolated.

Common situations: Developers on dotted branches like `v1.0` or slashed branches like `feat/ui` wanting to know the on-disk naming convention for variables/resources/scripts tied to that branch.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/9031c7d63850c0c2. Report an issue: GitHub.