{"record":{"id":"d26dbf787fd24021","repo":"windmill-labs/windmill","slug":"warning-current-git-branch-currentbranch","errorCode":null,"errorMessage":"⚠️  WARNING: Current Git branch '${currentBranch}' does not match any workspace in the configuration.\n   Consider adding a workspace entry for branch '${currentBranch}' in the 'workspaces' section of wmill.yaml.\n   Available workspaces: ${availableInfo}","messagePattern":"⚠️  WARNING: Current Git branch '(.+?)' does not match any workspace in the configuration\\.\n   Consider adding a workspace entry for branch '(.+?)' in the 'workspaces' section of wmill\\.yaml\\.\n   Available workspaces: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"cli/src/core/conf.ts","lineNumber":530,"sourceCode":"        );\n        return;\n      }\n    } else {\n      // Warn about filesystem-unsafe characters in branch name\n      if (/[\\/\\\\:*?\"<>|.]/.test(currentBranch)) {\n        const sanitizedBranchName = currentBranch.replace(\n          /[\\/\\\\:*?\"<>|.]/g,\n          \"_\"\n        );\n        log.warn(\n          `⚠️  WARNING: Branch name \"${currentBranch}\" contains filesystem-unsafe characters (/ \\\\ : * ? \" < > | .).`\n        );\n        log.warn(\n          `   Branch-specific files will use sanitized name: \"${sanitizedBranchName}\"`\n        );\n      }\n\n      log.warn(\n        `⚠️  WARNING: Current Git branch '${currentBranch}' does not match any workspace in the configuration.\\n` +\n          `   Consider adding a workspace entry for branch '${currentBranch}' in the 'workspaces' section of wmill.yaml.\\n` +\n          `   Available workspaces: ${availableInfo}`\n      );\n      return;\n    }\n  }\n}\n\n// Get effective settings by merging top-level settings with workspace-specific overrides.\n// workspaceNameOverride selects a workspace by name directly.\n// When not provided, auto-detects from the current git branch.\nexport async function getEffectiveSettings(\n  config: SyncOptions,\n  promotion?: string,\n  skipBranchValidation?: boolean,\n  suppressLogs?: boolean,\n  workspaceNameOverride?: string","sourceCodeStart":512,"sourceCodeEnd":548,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/cli/src/core/conf.ts#L512-L548","documentation":"This warning from `validateBranchConfiguration` fires in non-interactive mode when the current git branch does not match any workspace entry in `wmill.yaml` (checked via `findWorkspaceByGitBranch`, including each entry's effective `gitBranch`). The CLI lists the available workspaces and their branches, then returns without auto-creating anything, so the push/pull will proceed without a branch-resolved workspace configuration (or with whatever fallback the caller applies). It exists because branch→workspace auto-detection is a core convenience of git sync and a missing mapping usually means a misconfigured or freshly created branch.","triggerScenarios":"`wmill push`/`pull`/`gitsync-settings` in a git repo, workspaces section non-empty, no `--workspace`/`--skip-branch-validation`/`--yes`, `process.stdin.isTTY` falsy, and `getCurrentGitBranch()` (after fork resolution) equals no workspace's effective branch — e.g. branch `develop` while config only maps `main`.","commonSituations":"Opening a new feature branch with no corresponding `workspaces` entry, CI checking out a PR merge ref, cloning a repo and switching to a branch added after the config was last edited, or a `gitBranch` typo in `wmill.yaml`.","solutions":["Add a `workspaces` entry for the current branch in `wmill.yaml` (keyed by branch or with `gitBranch:` set to it).","Switch to a branch that has a matching workspace entry (`git checkout main`).","Run with `--workspace <name>` to target a workspace explicitly instead of branch detection.","Run with `--skip-branch-validation` if branch-based resolution is intentionally unused.","Verify the `gitBranch` values in `wmill.yaml` for typos (compare against `git branch --show-current`)."],"exampleFix":"# before (on branch develop)\nworkspaces:\n  main:\n    gitBranch: main\n\n# after\nworkspaces:\n  main:\n    gitBranch: main\n  develop:\n    gitBranch: develop","handlingStrategy":"validation","validationCode":"// verify branch-to-workspace coverage before push/pull\nimport { readConfigFile } from \"./conf.ts\"; // or parse the YAML yourself\nconst config = await readConfigFile();\nconst branch = $(\"git branch --show-current\").trim();\nconst entries = Object.entries(config.workspaces ?? {}) as [string, { gitBranch?: string }][];\nconst matched = entries.find(([, e]) => (e.gitBranch ?? name0(entries, e)) === branch);\nif (!matched) {\n  console.warn(`Branch \"${branch}\" not mapped. Available: ${entries.map(([n, e]) => `${n}(${e.gitBranch ?? n})`).join(\", \")}`);\n}\nfunction name0(entries: [string, unknown][], _e: unknown) { return entries[0][0]; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a workspaces entry for every long-lived branch the team syncs from.","Run a config check in CI comparing the checked-out branch against `wmill.yaml`.","Use `--workspace` or `--skip-branch-validation` in pipelines where branch detection is meaningless.","When creating a branch, add its workspace mapping in the same PR."],"tags":["cli","git","configuration","workspace-mapping"],"backgroundTag":"missing-workspace-mapping","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}