Dashboard › craft › Distillation
fd408461-81ff-43c8-b5c7-757479d33717["lore_tm_v1_3UGLi0WFPAygQcwtWviSil8O9GecWqU1tk7V1VGl_Ss","lore_tm_v1_cWewlVEQ0iwHs0S-LIUugddxpYuBGLsyAKoWAB_8nRI","lore_tm_v1_on8doHCiqptefWc36pvQ33lA6l6bDe2N-MhqwblJzCY"]
Date: Aug 24, 2026
--workspace --dry-run must never be mistaken for a workspace name./home/byk/Code/getsentry/craft-workspaces-schema/src/utils/helpers.ts (238 lines).src/utils/helpers.ts:16 exports MAX_STEP_OUTPUT_BYTES = 64 * 1024 (64 KB), selected to remain under the approximately 2 MB ARG_MAX kernel limit and GitHubβs approximately 65,536-character issue-body limit while avoiding GitHub Actions E2BIG errors when step outputs become subsequent-step environment variables.src/utils/helpers.ts:18-22 defines FALSY_ENV_VALUES as ['', 'undefined', 'null', '0', 'false', 'no']; envToBool(envVar) lowercases String(envVar) and returns false only for those values.src/utils/helpers.ts:42-70 implements extractWorkspaceSelection(argv, env = process.env): reads env.CRAFT_WORKSPACE, uses node:util parseArgs() with options: { workspace: { type: 'string' } }, allowPositionals: true, strict: false, and tokens: true; it accepts --workspace foo and --workspace=foo, scans option tokens named workspace, and uses last-valid-value-wins semantics matching yargs.extractWorkspaceSelection() only accepts a nonempty string token value when token.inlineValue is true or the value does not start with '-'; therefore --workspace=-foo is valid, while --workspace --foo does not select --foo as a workspace. A CLI workspace flag overrides CRAFT_WORKSPACE only when it has a valid value; otherwise it falls back to the environment variable and lets yargs report the invalid flag.src/utils/helpers.ts:72-109 defines GlobalFlags ('dry-run'?: boolean, 'no-input'?: boolean, 'log-level'?: keyof typeof LogLevel) and default GLOBAL_FLAGS: 'dry-run': false, 'no-input': false, 'log-level': 'Info'. setGlobals(argv) updates only supplied values, trace-logs globals and argv, and calls setLevel(LogLevel[GLOBAL_FLAGS['log-level']]); isDryRun() returns GLOBAL_FLAGS['dry-run'].src/utils/helpers.ts:114-136 promptConfirmation() prompts only when hasInput() is true, requiring text input of at least 2 characters and exact lowercase-normalized yes; any other response logs Oh, okay. Aborting. and exits with status 1. hasInput() is !GLOBAL_FLAGS['no-input']; no-input mode logs that confirmation was skipped.src/utils/helpers.ts:143-159 setGitHubActionsOutput(name, value) is a no-op without GITHUB_OUTPUT; single-line values append ${name}=${value}\n, while multiline values use a randomized delimiter EOF_${Date.now()}_${Math.random().toString(36).slice(2)} and heredoc syntax to avoid output-format issues.src/utils/helpers.ts:172-189 writeGitHubActionsFile(name, content) is a no-op without RUNNER_TEMP; otherwise it recursively creates ${RUNNER_TEMP}/craft, writes ${name}.md using UTF-8, sets the ${name}_file GitHub Actions output via setGitHubActionsOutput(), and returns the absolute file path. This avoids Linux E2BIG when large outputs are expanded in subsequent composite-action steps.src/utils/helpers.ts:199-226 truncateForOutput(value, changelogUrl?) leaves values at or below MAX_STEP_OUTPUT_BYTES unchanged; oversized UTF-8 values are byte-sliced to leave room for either \n\n---\n*Changelog truncated.* or \n\n---\n*Changelog truncated. [View full changelog](${changelogUrl}).*. It removes a trailing Unicode replacement character ('\uFFFD') only when slicing split a multibyte codepoint.src/utils/helpers.ts:228-238 disableChangelogMentions(changelog) replaces changelog-format matches by @author in with by **author** in using / by @(\S+) in /g, preventing contributor pings in embedded GitHub issue bodies while targeting formatChangelogEntry() output such as - Title by @author in [#123](url).